using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Threading;
using System.Windows.Forms;
namespace Easislides
{
	internal class ImageTransitionControl : Control
	{
		private enum PanelType
		{
			NoAction,
			Current,
			CurrentWithTrans,
			New,
			NewWithTrans
		}
		public enum TransitionTypes
		{
			None,
			Ascend,
			Away,
			Blinds_H,
			Blinds_V,
			BowTie,
			Checkerboard,
			Circle,
			CircularWipe,
			Cross,
			Descend,
			Diamond,
			Dissolve,
			DoorsOpen,
			DoorsClose,
			Fade,
			FanUp,
			Flip_H,
			Flip_V,
			Gentle_Zoom,
			Heart,
			Mesh,
			InTop,
			InLeft,
			InRight,
			InBottom,
			InTopLeft,
			InTopRight,
			InBottomLeft,
			InBottomRight,
			Mosaic,
			OutTop,
			OutLeft,
			OutRight,
			OutBottom,
			OutTopLeft,
			OutTopRight,
			OutBottomLeft,
			OutBottomRight,
			Oval,
			RandomBars,
			Rectangle,
			RectangleIn,
			RevealTopDown,
			RevealLeftRight,
			RevealRightLeft,
			RevealDownUp,
			Scroll,
			Spin,
			Spiral,
			Star,
			Stretch_H,
			Stretch_V,
			Wedge,
			WindMill,
			Zoom_Away,
			Zoom_In,
			Zoom_Out
		}
		public enum TransitionAction
		{
			None,
			AsStored,
			AsStoredItem,
			AsStoredSlide,
			AsFade
		}
		public enum BackPicturesTransition
		{
			None,
			CurrentOnly,
			NewOnly,
			BothBackgrounds
		}
		public const int MaxTransitions = 58;
		private const int MaxBits = 150000;
		private System.Threading.Timer t;
		private Graphics wsg;
		private string[] _transitionItem = new string[58];
		private bool ItemFirstShowing = false;
		private bool[] BitsArray = new bool[150000];
		private int TotalBitsArraySet = 0;
		private int DissolveSize = 0;
		private int DissolveCountX = 0;
		private int DissolveCountY = 0;
		private int DissolveTotal = 0;
		private Graphics Newg;
		private Image Newbmp;
		private ImageTransitionControl.TransitionTypes _itemTransitionType = ImageTransitionControl.TransitionTypes.None;
		private ImageTransitionControl.TransitionTypes _slideTransitionType = ImageTransitionControl.TransitionTypes.None;
		private ImageTransitionControl.TransitionTypes _transitionType = ImageTransitionControl.TransitionTypes.None;
		private ImageTransitionControl.TransitionTypes _previousTransitionType = ImageTransitionControl.TransitionTypes.None;
		private int _nHDivs = 10;
		private int _nVDivs = 8;
		private string _imageFileName = "";
		private int _picMode = 0;
		private Image _currentCombinedImage;
		private Image _newCombinedImage;
		private Image _newBackgroundPicture;
		private Image _currentBackgroundPicture;
		private Image _newTextImage;
		private Image _currentTextImage;
		private Image _newPanelImage;
		private Image _currentPanelImage;
		private Image _imageWorkSpace;
		private ImageTransitionControl.BackPicturesTransition _transitBackPictureAction = ImageTransitionControl.BackPicturesTransition.BothBackgrounds;
		private bool _itemChanged = true;
		private string _backgroundID = "";
		private TimeSpan _transitionTime = new TimeSpan(0, 0, 0, 1, 0);
		private float _currentPercentage = 0f;
		private DateTime _startTime;
		private Image AlertimageBackground;
		private Image AlertimageMessage;
		private Image AlertimageBackground_Inverse;
		private Image AlertimageMessage_Inverse;
		private Graphics alertg;
		private Graphics alertMessageg;
		private Graphics alertg_Inverse;
		private Graphics alertMessageg_Inverse;
		private int AlertMessageOriginX = 0;
		private int AlertMessageOriginY = 0;
		private int AlertOccurences = 0;
		private int AlertGapDuration = 7;
		private float AlertCharPerSecond = 6f;
		private bool AlertGapRunning = false;
		private int AlertFlashCount = 0;
		private int AlertFlashCountMax = 20;
		private bool AlertFlashAtStart = false;
		private int AlertBorder = 20;
		private Rectangle AlertOverallBackGroundRect = default(Rectangle);
		private Rectangle AlertMessageBackGroundRect = default(Rectangle);
		private int AlertOriginY = 0;
		private bool AlertScroll = false;
		private bool AlertFlash = false;
		private bool AlertTransparent = true;
		private DateTime AlertStartTime;
		private DateTime AlertMessageStartTime;
		private DateTime AlertGapStartTime;
		private float AlertOverallCurrentPercentage = 100f;
		private float AlertMessagePercentage = 100f;
		private bool AlertRunning = false;
		private int AlertAlign = 1;
		private System.Threading.Timer ta;
		private TimeSpan _alertTransitionTime = new TimeSpan(0, 0, 0, 1, 0);
		private TimeSpan _alertMessageTransitionTime = new TimeSpan(0, 0, 0, 1, 0);
		private Image RefimageBackground;
		private Image RefimageMessage;
		private Image RefimageBackground_Inverse;
		private Image RefimageMessage_Inverse;
		private Graphics refg;
		private Graphics refMessageg;
		private Graphics refg_Inverse;
		private Graphics refMessageg_Inverse;
		private int RefMessageOriginX = 0;
		private int RefMessageOriginY = 0;
		private int RefOccurences = 0;
		private int RefGapDuration = 7;
		private float RefCharPerSecond = 8f;
		private bool RefGapRunning = false;
		private int RefFlashCount = 0;
		private int RefFlashCountMax = 28;
		private bool RefFlashAtStart = false;
		private int RefBorder = 25;
		private Rectangle RefOverallBackGroundRect = default(Rectangle);
		private Rectangle RefMessageBackGroundRect = default(Rectangle);
		private Rectangle ClientBackgroundReducedRect = default(Rectangle);
		private Rectangle ClientMessageReducedRect = default(Rectangle);
		private int RefOriginY = 0;
		private bool RefScroll = false;
		private bool RefFlash = false;
		private bool RefTransparent = true;
		private DateTime RefStartTime;
		private DateTime RefMessageStartTime;
		private DateTime RefGapStartTime;
		private float RefOverallCurrentPercentage = 100f;
		private float RefMessagePercentage = 100f;
		private bool RefRunning = false;
		private int RefAlign = 1;
		private System.Threading.Timer tr;
		private TimeSpan _refTransitionTime = new TimeSpan(0, 0, 0, 1, 0);
		public string RefDisplayString = "";
		private TimeSpan _refMessageTransitionTime = new TimeSpan(0, 0, 0, 1, 0);
		public ImageTransitionControl.TransitionTypes TransitionType
		{
			get
			{
				return this._transitionType;
			}
			set
			{
				this._transitionType = value;
			}
		}
		public ImageTransitionControl.TransitionTypes PreviousTransitionType
		{
			get
			{
				return this._previousTransitionType;
			}
			set
			{
				this._previousTransitionType = value;
			}
		}
		public int HorizontalDivisions
		{
			get
			{
				return this._nHDivs;
			}
			set
			{
				if (value == 0)
				{
					value = 10;
				}
				this._nHDivs = value;
			}
		}
		public int VerticalDivisions
		{
			get
			{
				return this._nVDivs;
			}
			set
			{
				if (value == 0)
				{
					value = 8;
				}
				this._nVDivs = value;
			}
		}
		public string ImageFileName
		{
			get
			{
				return this._imageFileName;
			}
			set
			{
				this._imageFileName = value;
			}
		}
		public int PicMode
		{
			get
			{
				return this._picMode;
			}
			set
			{
				this._picMode = value;
			}
		}
		public Image CurrentCombinedImage
		{
			get
			{
				return this._currentCombinedImage;
			}
			set
			{
				this._currentCombinedImage = value;
			}
		}
		public Image NewCombinedImage
		{
			get
			{
				return this._newCombinedImage;
			}
			set
			{
				this._newCombinedImage = value;
			}
		}
		public Image NewBackgroundPicture
		{
			get
			{
				return this._newBackgroundPicture;
			}
			set
			{
				this._newBackgroundPicture = value;
			}
		}
		public Image CurrentBackgroundPicture
		{
			get
			{
				return this._currentBackgroundPicture;
			}
			set
			{
				this._currentBackgroundPicture = value;
			}
		}
		public Image NewTextImage
		{
			get
			{
				return this._newTextImage;
			}
			set
			{
				this._newTextImage = value;
			}
		}
		public Image CurrentTextImage
		{
			get
			{
				return this._currentTextImage;
			}
			set
			{
				this._currentTextImage = value;
			}
		}
		public Image NewPanelImage
		{
			get
			{
				return this._newPanelImage;
			}
			set
			{
				this._newPanelImage = value;
			}
		}
		public Image CurrentPanelImage
		{
			get
			{
				return this._currentPanelImage;
			}
			set
			{
				this._currentPanelImage = value;
			}
		}
		public Image ImageWorkSpace
		{
			get
			{
				return this._imageWorkSpace;
			}
			set
			{
				this._imageWorkSpace = value;
			}
		}
		public ImageTransitionControl.BackPicturesTransition TransitBackPictureAction
		{
			get
			{
				return this._transitBackPictureAction;
			}
			set
			{
				this._transitBackPictureAction = value;
			}
		}
		public bool ItemChanged
		{
			get
			{
				return this._itemChanged;
			}
			set
			{
				this._itemChanged = value;
			}
		}
		public string BackgroundID
		{
			get
			{
				return this._backgroundID;
			}
			set
			{
				this._backgroundID = value;
			}
		}
		public float TransitionTime
		{
			get
			{
				return Convert.ToSingle(this._transitionTime.TotalSeconds);
			}
			set
			{
				this._transitionTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(1000f * value));
			}
		}
		public float AlertTransitionTime
		{
			get
			{
				return Convert.ToSingle(this._alertTransitionTime.TotalSeconds);
			}
			set
			{
				this._alertTransitionTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(1000f * value));
			}
		}
		public float AlertMessageTransitionTime
		{
			get
			{
				return Convert.ToSingle(this._alertMessageTransitionTime.TotalSeconds);
			}
			set
			{
				this._alertMessageTransitionTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(1000f * value));
			}
		}
		public float RefTransitionTime
		{
			get
			{
				return Convert.ToSingle(this._refTransitionTime.TotalSeconds);
			}
			set
			{
				this._refTransitionTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(1000f * value));
			}
		}
		public float RefMessageTransitionTime
		{
			get
			{
				return Convert.ToSingle(this._refMessageTransitionTime.TotalSeconds);
			}
			set
			{
				this._refMessageTransitionTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(1000f * value));
			}
		}
		public void BuildTransitionArray()
		{
			this._transitionItem[0] = "None";
			this._transitionItem[1] = "Ascend";
			this._transitionItem[2] = "Away";
			this._transitionItem[3] = "Blinds Horizontal";
			this._transitionItem[4] = "Blinds Vertical";
			this._transitionItem[5] = "Bow Tie";
			this._transitionItem[6] = "Checkerboard";
			this._transitionItem[7] = "Circle";
			this._transitionItem[8] = "Circular Wipe";
			this._transitionItem[9] = "Cross";
			this._transitionItem[10] = "Descend";
			this._transitionItem[11] = "Diamond";
			this._transitionItem[12] = "Dissolve";
			this._transitionItem[13] = "Doors Open";
			this._transitionItem[14] = "Doors Close";
			this._transitionItem[15] = "Fade";
			this._transitionItem[16] = "Fan Up";
			this._transitionItem[17] = "Flip Horizontal";
			this._transitionItem[18] = "Flip Vertical";
			this._transitionItem[19] = "Gentle Zoom";
			this._transitionItem[20] = "Heart";
			this._transitionItem[21] = "Mesh";
			this._transitionItem[22] = "In Top";
			this._transitionItem[23] = "In Left";
			this._transitionItem[24] = "In Right";
			this._transitionItem[25] = "In Bottom";
			this._transitionItem[26] = "In Top Left";
			this._transitionItem[27] = "In Top Right";
			this._transitionItem[28] = "In Bottom Left";
			this._transitionItem[29] = "In Bottom Right";
			this._transitionItem[30] = "Mosaic";
			this._transitionItem[31] = "Out Top";
			this._transitionItem[32] = "Out Left";
			this._transitionItem[33] = "Out Right";
			this._transitionItem[34] = "Out Bottom";
			this._transitionItem[35] = "Out Top Left";
			this._transitionItem[36] = "Out Top Right";
			this._transitionItem[37] = "Out Bottom Left";
			this._transitionItem[38] = "Out Bottom Right";
			this._transitionItem[39] = "Oval";
			this._transitionItem[40] = "Random Bars";
			this._transitionItem[41] = "Rectangle";
			this._transitionItem[42] = "Rectangle In";
			this._transitionItem[43] = "Reveal Top Down";
			this._transitionItem[44] = "Reveal Left Right";
			this._transitionItem[45] = "Reveal Right Left";
			this._transitionItem[46] = "Reveal Down Up";
			this._transitionItem[47] = "Scroll";
			this._transitionItem[48] = "Spin";
			this._transitionItem[49] = "Spiral";
			this._transitionItem[50] = "Star";
			this._transitionItem[51] = "Stretch Horizontal";
			this._transitionItem[52] = "Stretch Vertical";
			this._transitionItem[53] = "Wedge";
			this._transitionItem[54] = "WindMill";
			this._transitionItem[55] = "Zoom Away";
			this._transitionItem[56] = "Zoom In";
			this._transitionItem[57] = "Zoom Out";
		}
		public void ResetBitsArray()
		{
			for (int i = 0; i < 60000; i++)
			{
				this.BitsArray[i] = false;
			}
			int num = (this.TransitionType == ImageTransitionControl.TransitionTypes.Dissolve) ? 90000 : 20000;
			this.TotalBitsArraySet = 0;
			this.DissolveSize = base.Height * base.Width / num + 1;
			this.DissolveCountX = base.Width / this.DissolveSize + 1;
			this.DissolveCountY = base.Height / this.DissolveSize + 1;
			this.DissolveTotal = this.DissolveCountX * this.DissolveCountY;
		}
		public void BuildTransitionsList(ref ToolStripComboBox InCombo)
		{
			this.BuildTransitionsList(ref InCombo, ImageTransitionControl.TransitionTypes.None);
		}
		public void BuildTransitionsList(ref ToolStripComboBox InCombo, ImageTransitionControl.TransitionTypes SelectedTransition)
		{
			InCombo.Items.Clear();
			for (int i = 0; i < 58; i++)
			{
				InCombo.Items.Add(this._transitionItem[i]);
			}
			InCombo.SelectedIndex = (int)SelectedTransition;
		}
		public int GetTransitionType(string SelectedTransitionText)
		{
			SelectedTransitionText = gf.Trim(SelectedTransitionText);
			int result;
			if (SelectedTransitionText == "")
			{
				result = 0;
			}
			else
			{
				for (int i = 0; i < 58; i++)
				{
					if (this._transitionItem[i] == SelectedTransitionText)
					{
						result = i;
						return result;
					}
				}
				result = 0;
			}
			return result;
		}
		public string GetTransitionText(int InTransitionType)
		{
			string result;
			try
			{
				result = this._transitionItem[InTransitionType];
				return result;
			}
			catch
			{
			}
			result = this._transitionItem[0];
			return result;
		}
		public ImageTransitionControl()
		{
			base.SetStyle(ControlStyles.UserPaint | ControlStyles.Opaque | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
			this.BuildTransitionArray();
			this.BackColor = gf.TransparentColour;
		}
		public void SetDefaultBackgroundPicture(Image InBitmap)
		{
			this.BackgroundImage = InBitmap;
		}
		public void Go(ImageTransitionControl.TransitionAction TransitionAction, bool InFirstShowing, bool ClearAll, bool DoActiveIndicator, bool LiveCamOnShow)
		{
			this.ItemFirstShowing = (InFirstShowing || DoActiveIndicator);
			this.Newbmp = new Bitmap(this.NewBackgroundPicture.Width, this.NewBackgroundPicture.Height, PixelFormat.Format32bppPArgb);
			this.Newg = Graphics.FromImage(this.Newbmp);
			if (LiveCamOnShow)
			{
				this.Newg.Clear(gf.TransparentColour);
			}
			else
			{
				this.Newg.DrawImageUnscaled(this.NewBackgroundPicture, 0, 0);
				this.Newg.DrawImageUnscaled(this.NewTextImage, 0, 0);
				this.Newg.DrawImageUnscaled(this.NewPanelImage, 0, 0);
			}
			if (TransitionAction == ImageTransitionControl.TransitionAction.None)
			{
				this._currentPercentage = 100f;
				if (ClearAll)
				{
					this.StopRef();
				}
				this.NewCombinedImage = this.Newbmp;
				base.Invalidate();
			}
			else
			{
				if (this.NewCombinedImage != null)
				{
					this.CurrentCombinedImage = this.NewCombinedImage;
				}
				this.ImageWorkSpace = this.NewCombinedImage;
				this.NewCombinedImage = this.Newbmp;
				this._previousTransitionType = this._transitionType;
				if (TransitionAction == ImageTransitionControl.TransitionAction.AsFade)
				{
					this._transitionType = ImageTransitionControl.TransitionTypes.Fade;
				}
				this.t = new System.Threading.Timer(new TimerCallback(this.Tick), null, 40, 40);
				this._currentPercentage = 0f;
				this._startTime = DateTime.Now;
				this.ResetBitsArray();
				if (ClearAll)
				{
					this.StopRef();
				}
				base.Invalidate();
			}
		}
		private void Tick(object state)
		{
			TimeSpan timeSpan = DateTime.Now.Subtract(this._startTime);
			this._currentPercentage = ((this.TransitionType == ImageTransitionControl.TransitionTypes.None) ? 100f : Convert.ToSingle(100.0 / this._transitionTime.TotalSeconds * timeSpan.TotalSeconds));
			if (this._currentPercentage > 100f)
			{
				this._currentPercentage = 100f;
			}
			base.Invalidate();
		}
		private void DrawDefaultBackPattern(PaintEventArgs e)
		{
			this.DrawImageToOutput(e, this.BackgroundImage, base.ClientRectangle, new Rectangle(0, 0, this.BackgroundImage.Width, this.BackgroundImage.Height), false, null);
		}
		private void DrawBackPatternOnWorkSpace(ref Graphics g, Image InBackgroundImage)
		{
			g.DrawImage(InBackgroundImage, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
		}
		protected override void OnPaint(PaintEventArgs e)
		{
			if (this._currentCombinedImage == null || this._newCombinedImage == null)
			{
				this.DrawDefaultBackPattern(e);
			}
			else
			{
				if (this._currentPercentage < 100f)
				{
					if (this.TransitionType == ImageTransitionControl.TransitionTypes.None)
					{
						this.Draw_NewImageBitBlt(e);
					}
					else
					{
						if (this.TransitionType == ImageTransitionControl.TransitionTypes.Ascend)
						{
							ImageAttributes imageAttributes = new ImageAttributes();
							ColorMatrix colorMatrix = new ColorMatrix();
							ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
							if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
							{
								this.Draw_CurrentImage(e);
								colorMatrix.Matrix33 = 0.003921569f * (255f * this._currentPercentage / 100f);
								imageAttributes.SetColorMatrix(colorMatrix);
								float num = 0.15f * (float)this._newCombinedImage.Height;
								int num2 = (int)(num * this._currentPercentage / 100f - num);
								this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, num2, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes);
								imageAttributes.Dispose();
							}
							else
							{
								this.DrawImageToOutput(e, this._currentBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, null);
								float num3 = 0.003921569f * (255f * (1f - this._currentPercentage / 60f));
								num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
								colorMatrix.Matrix33 = num3;
								imageAttributes.SetColorMatrix(colorMatrix);
								this.DrawImageToOutput(e, this._currentTextImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes, ImageTransitionControl.PanelType.Current);
								num3 = 0.003921569f * (510f * this._currentPercentage / 100f);
								num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
								colorMatrix.Matrix33 = num3;
								imageAttributes.SetColorMatrix(colorMatrix);
								float num = 0.15f * (float)this._newCombinedImage.Height;
								int num2 = (int)(num * this._currentPercentage / 100f - num);
								this.DrawImageToOutput(e, this._newTextImage, base.ClientRectangle, new Rectangle(0, num2, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes, ImageTransitionControl.PanelType.New);
								imageAttributes.Dispose();
							}
						}
						else
						{
							if (this.TransitionType == ImageTransitionControl.TransitionTypes.Descend)
							{
								ImageAttributes imageAttributes = new ImageAttributes();
								ColorMatrix colorMatrix = new ColorMatrix();
								ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
								if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
								{
									this.Draw_CurrentImage(e);
									colorMatrix.Matrix33 = 0.003921569f * (255f * this._currentPercentage / 100f);
									imageAttributes.SetColorMatrix(colorMatrix);
									float num = 0.15f * (float)this._newCombinedImage.Height;
									int num2 = (int)(num - num * this._currentPercentage / 100f);
									this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, num2, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes);
									imageAttributes.Dispose();
								}
								else
								{
									this.DrawImageToOutput(e, this._currentBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, null);
									float num3 = 0.003921569f * (255f * (1f - this._currentPercentage / 60f));
									num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
									colorMatrix.Matrix33 = num3;
									imageAttributes.SetColorMatrix(colorMatrix);
									this.DrawImageToOutput(e, this._currentTextImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes, ImageTransitionControl.PanelType.Current);
									num3 = 0.003921569f * (510f * this._currentPercentage / 100f);
									num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
									colorMatrix.Matrix33 = num3;
									imageAttributes.SetColorMatrix(colorMatrix);
									float num = 0.15f * (float)this._newCombinedImage.Height;
									int num2 = (int)(num - num * this._currentPercentage / 100f);
									this.DrawImageToOutput(e, this._newTextImage, base.ClientRectangle, new Rectangle(0, num2, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes, ImageTransitionControl.PanelType.New);
									imageAttributes.Dispose();
								}
							}
							else
							{
								if (this.TransitionType == ImageTransitionControl.TransitionTypes.DoorsOpen)
								{
									this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
									this.wsg = Graphics.FromImage(this._imageWorkSpace);
									this.wsg.Clear(Color.Transparent);
									int srcX = 0;
									int srcY = 0;
									int srcWidth = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
									int height = this._newBackgroundPicture.Height;
									Rectangle destRect = new Rectangle(0, 0, Convert.ToInt32((float)(this._newBackgroundPicture.Width / 2) - (float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), this._newBackgroundPicture.Height);
									int srcX2 = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
									int srcY2 = 0;
									int srcWidth2 = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
									int height2 = this._newBackgroundPicture.Height;
									Rectangle destRect2 = new Rectangle(Convert.ToInt32((float)(this._newBackgroundPicture.Width / 2) + (float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), 0, Convert.ToInt32((float)(this._newBackgroundPicture.Width / 2) - (float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), this._newBackgroundPicture.Height);
									ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
									if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
									{
										this.Draw_NewImage(e);
										this.wsg.DrawImage(this._currentCombinedImage, destRect, srcX, srcY, srcWidth, height, GraphicsUnit.Pixel);
										this.wsg.DrawImage(this._currentCombinedImage, destRect2, srcX2, srcY2, srcWidth2, height2, GraphicsUnit.Pixel);
										this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
									}
									else
									{
										this.Draw_NewImage(e);
										this.wsg.DrawImage(this._newBackgroundPicture, destRect, destRect.X, destRect.Y, destRect.Width, destRect.Height, GraphicsUnit.Pixel);
										this.wsg.DrawImage(this._newBackgroundPicture, destRect2, destRect2.X, destRect2.Y, destRect2.Width, destRect2.Height, GraphicsUnit.Pixel);
										this.wsg.DrawImage(this._currentTextImage, destRect, srcX, srcY, srcWidth, height, GraphicsUnit.Pixel);
										this.wsg.DrawImage(this._currentTextImage, destRect2, srcX2, srcY2, srcWidth2, height2, GraphicsUnit.Pixel);
										this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
									}
								}
								else
								{
									if (this.TransitionType == ImageTransitionControl.TransitionTypes.DoorsClose)
									{
										this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
										this.wsg = Graphics.FromImage(this._imageWorkSpace);
										this.wsg.Clear(Color.Transparent);
										int srcX = 0;
										int srcY = 0;
										int srcWidth = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
										int height = this._newBackgroundPicture.Height;
										Rectangle destRect = new Rectangle(0, 0, Convert.ToInt32((float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), this._newBackgroundPicture.Height);
										int srcX2 = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
										int srcY2 = 0;
										int srcWidth2 = Convert.ToInt32(this._newBackgroundPicture.Width / 2);
										int height2 = this._newBackgroundPicture.Height;
										Rectangle destRect2 = new Rectangle(Convert.ToInt32((float)this._newBackgroundPicture.Width - (float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), 0, Convert.ToInt32((float)this._newBackgroundPicture.Width * this._currentPercentage / 200f), this._newBackgroundPicture.Height);
										ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
										if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
										{
											this.Draw_CurrentImage(e);
											this.wsg.DrawImage(this._newCombinedImage, destRect, srcX, srcY, srcWidth, height, GraphicsUnit.Pixel);
											this.wsg.DrawImage(this._newCombinedImage, destRect2, srcX2, srcY2, srcWidth2, height2, GraphicsUnit.Pixel);
											this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
										}
										else
										{
											this.Draw_CurrentImage(e);
											this.wsg.DrawImage(this._newBackgroundPicture, destRect, destRect.X, destRect.Y, destRect.Width, destRect.Height, GraphicsUnit.Pixel);
											this.wsg.DrawImage(this._newBackgroundPicture, destRect2, destRect2.X, destRect2.Y, destRect2.Width, destRect2.Height, GraphicsUnit.Pixel);
											this.wsg.DrawImage(this._newTextImage, destRect, srcX, srcY, srcWidth, height, GraphicsUnit.Pixel);
											this.wsg.DrawImage(this._newTextImage, destRect2, srcX2, srcY2, srcWidth2, height2, GraphicsUnit.Pixel);
											this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.New);
										}
									}
									else
									{
										if (this.TransitionType == ImageTransitionControl.TransitionTypes.Blinds_H)
										{
											this.Draw_CurrentImage(e);
											for (int i = 0; i <= this._nHDivs; i++)
											{
												Rectangle sourceRectangle = new Rectangle(0, i * (this._newCombinedImage.Height / this._nHDivs), this._newCombinedImage.Width, Convert.ToInt32((float)(this._newCombinedImage.Height / this._nHDivs) * this._currentPercentage / 100f));
												Rectangle rectangle = new Rectangle(0, i * (base.Height / this._nHDivs), base.Width, Convert.ToInt32((float)(base.Height / this._nHDivs) * this._currentPercentage / 100f));
												this.DrawImageToOutput(e, this._newCombinedImage, rectangle, sourceRectangle, true, null);
											}
										}
										else
										{
											if (this.TransitionType == ImageTransitionControl.TransitionTypes.Blinds_V)
											{
												this.Draw_CurrentImage(e);
												for (int j = 0; j <= this._nVDivs; j++)
												{
													Rectangle sourceRectangle = new Rectangle(j * (this._newCombinedImage.Width / this._nVDivs), 0, Convert.ToInt32((float)(this._newCombinedImage.Width / this._nVDivs) * this._currentPercentage / 100f), this._newCombinedImage.Height);
													Rectangle rectangle = new Rectangle(j * (base.Width / this._nVDivs), 0, Convert.ToInt32((float)(base.Width / this._nVDivs) * this._currentPercentage / 100f), base.Height);
													this.DrawImageToOutput(e, this._newCombinedImage, rectangle, sourceRectangle, true, null);
												}
											}
											else
											{
												if (this.TransitionType == ImageTransitionControl.TransitionTypes.Rectangle)
												{
													this.Draw_CurrentImage(e);
													GraphicsPath graphicsPath = new GraphicsPath();
													int num4 = Convert.ToInt32((float)base.Width * this._currentPercentage / 200f);
													int num5 = Convert.ToInt32((float)base.Height * this._currentPercentage / 200f);
													graphicsPath.AddRectangle(new Rectangle(Convert.ToInt32(base.Width / 2 - num4), Convert.ToInt32(base.Height / 2 - num5), Convert.ToInt32(2 * num4), Convert.ToInt32(2 * num5)));
													e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
													this.Draw_NewImage(e);
													graphicsPath.Dispose();
												}
												else
												{
													if (this.TransitionType == ImageTransitionControl.TransitionTypes.RectangleIn)
													{
														this.Draw_NewImage(e);
														GraphicsPath graphicsPath = new GraphicsPath();
														int num4 = Convert.ToInt32((float)base.Width * (100f - this._currentPercentage) / 200f);
														int num5 = Convert.ToInt32((float)base.Height * (100f - this._currentPercentage) / 200f);
														graphicsPath.AddRectangle(new Rectangle(Convert.ToInt32(base.Width / 2 - num4), Convert.ToInt32(base.Height / 2 - num5), Convert.ToInt32(2 * num4), Convert.ToInt32(2 * num5)));
														e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
														this.Draw_CurrentImage(e);
														graphicsPath.Dispose();
													}
													else
													{
														if (this.TransitionType == ImageTransitionControl.TransitionTypes.Checkerboard)
														{
															this.Draw_CurrentImage(e);
															GraphicsPath graphicsPath = new GraphicsPath();
															int width = Convert.ToInt32((float)base.Width * this._currentPercentage / 100f) / this._nHDivs;
															int num6 = base.Height / this._nVDivs;
															int num7 = 0;
															for (int i = 0; i <= base.Height; i += num6)
															{
																for (int j = 0; j <= base.Width; j += base.Width / this._nHDivs)
																{
																	Rectangle rect = new Rectangle(j, i, width, num6);
																	if ((num7 & 1) == 1)
																	{
																		rect.Offset(base.Width / (2 * this._nVDivs), 0);
																	}
																	graphicsPath.AddRectangle(rect);
																	if (this._currentPercentage >= 50f && (num7 & 1) == 1 && j == 0)
																	{
																		rect.Offset(-(base.Width / this._nHDivs), 0);
																		graphicsPath.AddRectangle(rect);
																	}
																}
																num7++;
															}
															Region region = new Region(graphicsPath);
															e.Graphics.SetClip(region, CombineMode.Replace);
															this.Draw_NewImage(e);
															region.Dispose();
															graphicsPath.Dispose();
														}
														else
														{
															if (this.TransitionType == ImageTransitionControl.TransitionTypes.Circle)
															{
																this.Draw_CurrentImage(e);
																GraphicsPath graphicsPath = new GraphicsPath();
																int num4 = Convert.ToInt32((float)base.Width * 1.414f * this._currentPercentage / 200f);
																graphicsPath.AddEllipse(Convert.ToInt32(base.Width / 2 - num4), Convert.ToInt32(base.Height / 2 - num4), Convert.ToInt32(2 * num4), Convert.ToInt32(2 * num4));
																e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																this.Draw_NewImage(e);
																graphicsPath.Dispose();
															}
															else
															{
																if (this.TransitionType == ImageTransitionControl.TransitionTypes.Cross)
																{
																	this.Draw_CurrentImage(e);
																	GraphicsPath graphicsPath = new GraphicsPath();
																	GraphicsPath graphicsPath2 = new GraphicsPath();
																	int num4 = Convert.ToInt32((float)base.Width * this._currentPercentage / 200f);
																	int num5 = Convert.ToInt32((float)base.Height * this._currentPercentage / 40f);
																	graphicsPath.AddRectangle(new Rectangle(Convert.ToInt32(base.Width / 2 - num5), Convert.ToInt32(base.Height / 2 - num4), Convert.ToInt32(2 * num5), Convert.ToInt32(2 * num4)));
																	e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																	graphicsPath.AddRectangle(new Rectangle(Convert.ToInt32(base.Width / 2 - num4), Convert.ToInt32(base.Height / 2 - num5), Convert.ToInt32(2 * num4), Convert.ToInt32(2 * num5)));
																	e.Graphics.SetClip(graphicsPath, CombineMode.Union);
																	this.Draw_NewImage(e);
																	graphicsPath.Dispose();
																}
																else
																{
																	if (this.TransitionType == ImageTransitionControl.TransitionTypes.Diamond)
																	{
																		this.Draw_CurrentImage(e);
																		int num4 = Convert.ToInt32((float)base.Width * this._currentPercentage / 100f);
																		int num5 = Convert.ToInt32((float)base.Height * this._currentPercentage / 100f);
																		int num8 = Convert.ToInt32(base.Width / 2);
																		int num9 = Convert.ToInt32(base.Height / 2);
																		GraphicsPath graphicsPath = new GraphicsPath();
																		graphicsPath.AddPolygon(new Point[]
																		{
																			new Point(num8, num9 - num5),
																			new Point(num8 - num4, num9),
																			new Point(num8, num9 + num5),
																			new Point(num8 + num4, num9)
																		});
																		e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																		this.Draw_NewImage(e);
																		graphicsPath.Dispose();
																	}
																	else
																	{
																		if (this.TransitionType == ImageTransitionControl.TransitionTypes.Fade)
																		{
																			this.Draw_CurrentImage(e);
																			ImageAttributes imageAttributes = new ImageAttributes();
																			imageAttributes.SetColorMatrix(new ColorMatrix
																			{
																				Matrix33 = 0.003921569f * (255f * this._currentPercentage / 100f)
																			});
																			this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes);
																			imageAttributes.Dispose();
																		}
																		else
																		{
																			if (this.TransitionType == ImageTransitionControl.TransitionTypes.Flip_H)
																			{
																				ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																				if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.BothBackgrounds)
																				{
																					this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																					this.wsg = Graphics.FromImage(this._imageWorkSpace);
																					this.wsg.Clear(Color.Transparent);
																					int srcX3 = 0;
																					int srcY3 = 0;
																					int width2 = this._currentCombinedImage.Width;
																					int height3 = this._currentCombinedImage.Height;
																					int x = 0;
																					int width3 = this._currentCombinedImage.Width;
																					switch (this.TransitBackPictureAction)
																					{
																					case ImageTransitionControl.BackPicturesTransition.CurrentOnly:
																						this.DrawBackPatternOnWorkSpace(ref this.wsg, this.BackgroundImage);
																						if (this._currentPercentage < 50f)
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._currentCombinedImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																						}
																						else
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height * (this._currentPercentage - 50f) / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._newTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.wsg.DrawImage(this._newPanelImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																						}
																						break;
																					case ImageTransitionControl.BackPicturesTransition.NewOnly:
																						this.DrawBackPatternOnWorkSpace(ref this.wsg, this.BackgroundImage);
																						if (this._currentPercentage < 50f)
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._currentTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.wsg.DrawImage(this._currentPanelImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																						}
																						else
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height * (this._currentPercentage - 50f) / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._newCombinedImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																						}
																						break;
																					default:
																						this.DrawBackPatternOnWorkSpace(ref this.wsg, this.CurrentBackgroundPicture);
																						if (this._currentPercentage < 50f)
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._currentTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
																						}
																						else
																						{
																							int y = Convert.ToInt32((float)this._currentCombinedImage.Height - (float)this._currentCombinedImage.Height * this._currentPercentage / 100f);
																							int height4 = Convert.ToInt32((float)this._currentCombinedImage.Height * (this._currentPercentage - 50f) / 50f);
																							Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																							this.wsg.DrawImage(this._newTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.New);
																						}
																						break;
																					}
																				}
																				else
																				{
																					this.DrawDefaultBackPattern(e);
																					if (this._currentPercentage < 50f)
																					{
																						this.DrawImageToOutput(e, this._currentCombinedImage, new Rectangle(0, Convert.ToInt32((float)base.Height * this._currentPercentage / 100f), base.ClientRectangle.Width, Convert.ToInt32((float)base.Height - (float)base.Height * this._currentPercentage / 50f)), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																					}
																					else
																					{
																						this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(0, Convert.ToInt32((float)base.Height - (float)base.Height * this._currentPercentage / 100f), base.ClientRectangle.Width, Convert.ToInt32((float)base.Height * (this._currentPercentage - 50f) / 50f)), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																					}
																				}
																			}
																			else
																			{
																				if (this.TransitionType == ImageTransitionControl.TransitionTypes.Flip_V)
																				{
																					ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																					if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.BothBackgrounds)
																					{
																						this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																						this.wsg = Graphics.FromImage(this._imageWorkSpace);
																						this.wsg.Clear(Color.Transparent);
																						int srcX3 = 0;
																						int srcY3 = 0;
																						int width2 = this._currentCombinedImage.Width;
																						int height3 = this._currentCombinedImage.Height;
																						int y = 0;
																						int height4 = this._currentCombinedImage.Height;
																						switch (this.TransitBackPictureAction)
																						{
																						case ImageTransitionControl.BackPicturesTransition.CurrentOnly:
																							this.DrawBackPatternOnWorkSpace(ref this.wsg, this.BackgroundImage);
																							if (this._currentPercentage < 50f)
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._currentCombinedImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																							}
																							else
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width * (this._currentPercentage - 50f) / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._newTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.wsg.DrawImage(this._newPanelImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																							}
																							break;
																						case ImageTransitionControl.BackPicturesTransition.NewOnly:
																							this.DrawBackPatternOnWorkSpace(ref this.wsg, this.BackgroundImage);
																							if (this._currentPercentage < 50f)
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._currentTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.CurrentWithTrans);
																							}
																							else
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width * (this._currentPercentage - 50f) / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._newCombinedImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
																							}
																							break;
																						default:
																							this.DrawBackPatternOnWorkSpace(ref this.wsg, this.CurrentBackgroundPicture);
																							if (this._currentPercentage < 50f)
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._currentTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
																							}
																							else
																							{
																								int x = Convert.ToInt32((float)this._currentCombinedImage.Width - (float)this._currentCombinedImage.Width * this._currentPercentage / 100f);
																								int width3 = Convert.ToInt32((float)this._currentCombinedImage.Width * (this._currentPercentage - 50f) / 50f);
																								Rectangle destRect3 = new Rectangle(x, y, width3, height4);
																								this.wsg.DrawImage(this._newTextImage, destRect3, srcX3, srcY3, width2, height3, GraphicsUnit.Pixel);
																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.New);
																							}
																							break;
																						}
																					}
																					else
																					{
																						this.DrawDefaultBackPattern(e);
																						if (this._currentPercentage < 50f)
																						{
																							this.DrawImageToOutput(e, this._currentCombinedImage, new Rectangle(Convert.ToInt32((float)base.Width * this._currentPercentage / 100f), 0, Convert.ToInt32((float)base.Width - (float)base.Width * this._currentPercentage / 50f), base.ClientRectangle.Height), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																						}
																						else
																						{
																							this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(Convert.ToInt32((float)base.Width - (float)base.Width * this._currentPercentage / 100f), 0, Convert.ToInt32((float)base.Width * (this._currentPercentage - 50f) / 50f), base.ClientRectangle.Height), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																						}
																					}
																				}
																				else
																				{
																					if (this.TransitionType == ImageTransitionControl.TransitionTypes.Gentle_Zoom)
																					{
																						ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																						if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																						{
																							float num10 = 0.8f + 0.2f * this._currentPercentage / 100f;
																							if (num10 < 0f)
																							{
																								num10 = 0.8f;
																							}
																							else
																							{
																								if (num10 > 1f)
																								{
																									num10 = 1f;
																								}
																							}
																							ImageAttributes imageAttributes = new ImageAttributes();
																							ColorMatrix colorMatrix = new ColorMatrix();
																							float num3 = 0.003921569f * (255f * (1f - this._currentPercentage / 60f));
																							num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
																							colorMatrix.Matrix33 = num3;
																							imageAttributes.SetColorMatrix(colorMatrix);
																							this.DrawImageToOutput(e, this._currentCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, imageAttributes);
																							num3 = 0.003921569f * (510f * this._currentPercentage / 100f);
																							num3 = ((num3 > 1f) ? 1f : ((num3 < 0f) ? 0f : num3));
																							colorMatrix.Matrix33 = num3;
																							imageAttributes.SetColorMatrix(colorMatrix);
																							float dx = (float)(base.Width / 2);
																							float num11 = (float)(base.Height / 2);
																							Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx, num11);
																							e.Graphics.Transform = matrix;
																							this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, imageAttributes);
																							matrix.Dispose();
																							imageAttributes.Dispose();
																						}
																						else
																						{
																							float num10 = 0.85f + 0.15f * this._currentPercentage / 100f;
																							if (num10 < 0f)
																							{
																								num10 = 0.85f;
																							}
																							else
																							{
																								if (num10 > 1f)
																								{
																									num10 = 1f;
																								}
																							}
																							this.Draw_CurrentImage(e);
																							float dx = (float)(this._newBackgroundPicture.Width / 2);
																							float num11 = (float)(this._newBackgroundPicture.Height / 2);
																							this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																							this.wsg = Graphics.FromImage(this._imageWorkSpace);
																							this.wsg.Clear(Color.Transparent);
																							Rectangle rectangle = new Rectangle(-this._newBackgroundPicture.Width / 2, -1 - this._newBackgroundPicture.Height / 2, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																							Rectangle rectangle2 = new Rectangle(rectangle.Width / 2 - (int)(num10 * (float)rectangle.Width / 2f), rectangle.Height / 2 - (int)(num10 * (float)rectangle.Height / 2f), (int)(num10 * (float)rectangle.Width), (int)(num10 * (float)rectangle.Height));
																							this.wsg.DrawImage(this._newBackgroundPicture, rectangle2, rectangle2, GraphicsUnit.Pixel);
																							Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx, num11);
																							this.wsg.Transform = matrix2;
																							this.wsg.DrawImage(this._newTextImage, rectangle, 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.New);
																							matrix2.Dispose();
																						}
																					}
																					else
																					{
																						if (this.TransitionType == ImageTransitionControl.TransitionTypes.Oval)
																						{
																							this.Draw_CurrentImage(e);
																							GraphicsPath graphicsPath = new GraphicsPath();
																							int num4 = Convert.ToInt32((float)base.Width * 1.414f * this._currentPercentage / 200f);
																							int num5 = Convert.ToInt32((float)base.Height * 1.2f * this._currentPercentage / 200f);
																							graphicsPath.AddEllipse(Convert.ToInt32(base.Width / 2 - num4), Convert.ToInt32(base.Height / 2 - num5), Convert.ToInt32(2 * num4), Convert.ToInt32(2 * num5));
																							e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																							this.Draw_NewImage(e);
																							graphicsPath.Dispose();
																						}
																						else
																						{
																							if (this.TransitionType == ImageTransitionControl.TransitionTypes.Mesh)
																							{
																								this.Draw_CurrentImage(e);
																								int num12 = this._nHDivs * 5;
																								int num13 = this._nVDivs * 8;
																								GraphicsPath graphicsPath = new GraphicsPath();
																								int width = Convert.ToInt32((float)base.Width * this._currentPercentage / 100f) / num12;
																								int num6 = base.Height / num13;
																								int num7 = 0;
																								for (int i = 0; i <= base.Height; i += num6)
																								{
																									for (int j = 0; j <= base.Width; j += base.Width / num12)
																									{
																										Rectangle rect = new Rectangle(j, i, width, num6);
																										if ((num7 & 1) == 1)
																										{
																											rect.Offset(base.Width / (2 * num13), 0);
																										}
																										graphicsPath.AddRectangle(rect);
																										if (this._currentPercentage >= 50f && (num7 & 1) == 1 && j == 0)
																										{
																											rect.Offset(-(base.Width / num12), 0);
																											graphicsPath.AddRectangle(rect);
																										}
																									}
																									num7++;
																								}
																								Region region = new Region(graphicsPath);
																								e.Graphics.SetClip(region, CombineMode.Replace);
																								this.Draw_NewImage(e);
																								region.Dispose();
																								graphicsPath.Dispose();
																							}
																							else
																							{
																								if (this.TransitionType == ImageTransitionControl.TransitionTypes.InLeft)
																								{
																									this.Draw_TranSlideIn(e, this.TransitionType);
																								}
																								else
																								{
																									if (this.TransitionType == ImageTransitionControl.TransitionTypes.InTop)
																									{
																										this.Draw_TranSlideIn(e, this.TransitionType);
																									}
																									else
																									{
																										if (this.TransitionType == ImageTransitionControl.TransitionTypes.InRight)
																										{
																											this.Draw_TranSlideIn(e, this.TransitionType);
																										}
																										else
																										{
																											if (this.TransitionType == ImageTransitionControl.TransitionTypes.InBottom)
																											{
																												this.Draw_TranSlideIn(e, this.TransitionType);
																											}
																											else
																											{
																												if (this.TransitionType == ImageTransitionControl.TransitionTypes.InTopLeft)
																												{
																													this.Draw_TranSlideIn(e, this.TransitionType);
																												}
																												else
																												{
																													if (this.TransitionType == ImageTransitionControl.TransitionTypes.InTopRight)
																													{
																														this.Draw_TranSlideIn(e, this.TransitionType);
																													}
																													else
																													{
																														if (this.TransitionType == ImageTransitionControl.TransitionTypes.InBottomLeft)
																														{
																															this.Draw_TranSlideIn(e, this.TransitionType);
																														}
																														else
																														{
																															if (this.TransitionType == ImageTransitionControl.TransitionTypes.InBottomRight)
																															{
																																this.Draw_TranSlideIn(e, this.TransitionType);
																															}
																															else
																															{
																																if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutLeft)
																																{
																																	this.Draw_TranSlideOut(e, this.TransitionType);
																																}
																																else
																																{
																																	if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutTop)
																																	{
																																		this.Draw_TranSlideOut(e, this.TransitionType);
																																	}
																																	else
																																	{
																																		if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutRight)
																																		{
																																			this.Draw_TranSlideOut(e, this.TransitionType);
																																		}
																																		else
																																		{
																																			if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutBottom)
																																			{
																																				this.Draw_TranSlideOut(e, this.TransitionType);
																																			}
																																			else
																																			{
																																				if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutTopLeft)
																																				{
																																					this.Draw_TranSlideOut(e, this.TransitionType);
																																				}
																																				else
																																				{
																																					if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutTopRight)
																																					{
																																						this.Draw_TranSlideOut(e, this.TransitionType);
																																					}
																																					else
																																					{
																																						if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutBottomLeft)
																																						{
																																							this.Draw_TranSlideOut(e, this.TransitionType);
																																						}
																																						else
																																						{
																																							if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutBottomRight)
																																							{
																																								this.Draw_TranSlideOut(e, this.TransitionType);
																																							}
																																							else
																																							{
																																								if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutLeft)
																																								{
																																									this.Draw_TranSlideOut(e, this.TransitionType);
																																								}
																																								else
																																								{
																																									if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutTop)
																																									{
																																										this.Draw_TranSlideOut(e, this.TransitionType);
																																									}
																																									else
																																									{
																																										if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutRight)
																																										{
																																											this.Draw_TranSlideOut(e, this.TransitionType);
																																										}
																																										else
																																										{
																																											if (this.TransitionType == ImageTransitionControl.TransitionTypes.OutBottom)
																																											{
																																												this.Draw_TranSlideOut(e, this.TransitionType);
																																											}
																																											else
																																											{
																																												if (this.TransitionType == ImageTransitionControl.TransitionTypes.RevealLeftRight)
																																												{
																																													this.Draw_TranSlideReveal(e, this.TransitionType);
																																												}
																																												else
																																												{
																																													if (this.TransitionType == ImageTransitionControl.TransitionTypes.RevealTopDown)
																																													{
																																														this.Draw_TranSlideReveal(e, this.TransitionType);
																																													}
																																													else
																																													{
																																														if (this.TransitionType == ImageTransitionControl.TransitionTypes.RevealRightLeft)
																																														{
																																															this.Draw_TranSlideReveal(e, this.TransitionType);
																																														}
																																														else
																																														{
																																															if (this.TransitionType == ImageTransitionControl.TransitionTypes.RevealDownUp)
																																															{
																																																this.Draw_TranSlideReveal(e, this.TransitionType);
																																															}
																																															else
																																															{
																																																if (this.TransitionType == ImageTransitionControl.TransitionTypes.Scroll)
																																																{
																																																	int num2 = (int)((float)this._newCombinedImage.Height * this._currentPercentage / 100f);
																																																	ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																	if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																	{
																																																		this.DrawImageToOutput(e, this._currentCombinedImage, base.ClientRectangle, new Rectangle(0, num2, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, null);
																																																		this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, num2 - this._newCombinedImage.Height, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																	}
																																																	else
																																																	{
																																																		this.DrawImageToOutput(e, this._currentBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, null);
																																																		this.DrawImageToOutput(e, this._currentTextImage, base.ClientRectangle, new Rectangle(0, num2, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), false, null, ImageTransitionControl.PanelType.Current);
																																																		this.DrawImageToOutput(e, this._newTextImage, base.ClientRectangle, new Rectangle(0, num2 - this._newCombinedImage.Height, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																	}
																																																}
																																																else
																																																{
																																																	if (this.TransitionType == ImageTransitionControl.TransitionTypes.Spin)
																																																	{
																																																		float num14 = 360f * this._currentPercentage / 100f;
																																																		float dx2 = (float)(base.Width / 2);
																																																		float dy = (float)(base.Height / 2);
																																																		float num10 = 1f * this._currentPercentage / 100f;
																																																		if (num10 == 0f)
																																																		{
																																																			num10 = 0.01f;
																																																		}
																																																		ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																		if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																		{
																																																			this.Draw_CurrentImage(e);
																																																			Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx2, dy);
																																																			matrix.Rotate(num14, MatrixOrder.Prepend);
																																																			e.Graphics.Transform = matrix;
																																																			this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(-base.Width / 2, -base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																			matrix.Dispose();
																																																		}
																																																		else
																																																		{
																																																			this.DrawImageToOutput(e, this._newBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), true, null);
																																																			ImageAttributes imageAttributes = new ImageAttributes();
																																																			imageAttributes.SetColorMatrix(new ColorMatrix
																																																			{
																																																				Matrix33 = 0.003921569f * (255f * (1f - this._currentPercentage / 100f))
																																																			});
																																																			this.DrawImageToOutput(e, this._currentTextImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, imageAttributes, ImageTransitionControl.PanelType.Current);
																																																			this.DrawImageToOutput(e, this._currentPanelImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, null, ImageTransitionControl.PanelType.Current);
																																																			imageAttributes.Dispose();
																																																			Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx2, dy);
																																																			matrix2.Rotate(num14, MatrixOrder.Prepend);
																																																			e.Graphics.Transform = matrix2;
																																																			this.DrawImageToOutput(e, this._newTextImage, new Rectangle(-base.Width / 2, -base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																			matrix2.Dispose();
																																																		}
																																																	}
																																																	else
																																																	{
																																																		if (this.TransitionType == ImageTransitionControl.TransitionTypes.Spiral)
																																																		{
																																																			double num15 = 0.031415926535897934;
																																																			double num16 = (double)(Math.Max(base.Width * 2 / 3, base.Height * 2 / 3) / 100);
																																																			float num17 = (float)base.Width * 0.59f;
																																																			float num18 = (float)base.Height * 0.1475f;
																																																			double num19 = (double)(this._currentPercentage - 100f);
																																																			double num20 = (double)this._currentPercentage;
																																																			if (num19 < 0.0)
																																																			{
																																																				num19 = 0.0;
																																																			}
																																																			double num21 = num15 * num20;
																																																			PointF pointF = new PointF(Convert.ToSingle((double)num17 + num19 * num16 * Math.Cos(num21)), Convert.ToSingle((double)num18 + num19 * num16 * Math.Sin(num21)));
																																																			num21 = num15 * num19;
																																																			while (num19 <= num20)
																																																			{
																																																				PointF pointF2 = new PointF(Convert.ToSingle((double)num17 + num19 * num16 * Math.Cos(num21)), Convert.ToSingle((double)num18 + num19 * num16 * Math.Sin(num21)));
																																																				pointF = pointF2;
																																																				num19 += 0.1;
																																																				num21 += num15 / 10.0;
																																																			}
																																																			int width4 = (int)(this._currentPercentage * (float)base.ClientRectangle.Width / 100f);
																																																			int height5 = (int)(this._currentPercentage * (float)base.ClientRectangle.Height / 100f);
																																																			Rectangle destinationRectangle = new Rectangle((int)pointF.X, (int)pointF.Y, width4, height5);
																																																			ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																			if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																			{
																																																				this.Draw_CurrentImage(e);
																																																				this.DrawImageToOutput(e, this._newCombinedImage, destinationRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																			}
																																																			else
																																																			{
																																																				ImageAttributes imageAttributes = new ImageAttributes();
																																																				imageAttributes.SetColorMatrix(new ColorMatrix
																																																				{
																																																					Matrix33 = 0.003921569f * (255f * (1f - this._currentPercentage / 200f))
																																																				});
																																																				this.DrawImageToOutput(e, this._currentBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._currentBackgroundPicture.Width, this._currentBackgroundPicture.Height), true, null);
																																																				this.DrawImageToOutput(e, this._currentTextImage, base.ClientRectangle, new Rectangle(0, 0, this._currentTextImage.Width, this._currentTextImage.Height), false, imageAttributes, ImageTransitionControl.PanelType.Current);
																																																				this.DrawImageToOutput(e, this._currentPanelImage, base.ClientRectangle, new Rectangle(0, 0, this._currentTextImage.Width, this._currentTextImage.Height), false, null, ImageTransitionControl.PanelType.Current);
																																																				this.DrawImageToOutput(e, this._newTextImage, destinationRectangle, new Rectangle(0, 0, this._newTextImage.Width, this._newTextImage.Height), true, null, ImageTransitionControl.PanelType.NewWithTrans);
																																																				imageAttributes.Dispose();
																																																			}
																																																		}
																																																		else
																																																		{
																																																			if (this.TransitionType == ImageTransitionControl.TransitionTypes.Star)
																																																			{
																																																				this.Draw_CurrentImage(e);
																																																				PointF[] array = new PointF[11];
																																																				float num22 = (float)Convert.ToInt32((float)base.Width * this._currentPercentage / 130f);
																																																				float num23 = (float)Convert.ToInt32(base.Width / 2);
																																																				float num24 = (float)Convert.ToInt32(base.Height / 2);
																																																				float num25 = 0f;
																																																				bool flag = false;
																																																				int num26 = 0;
																																																				while ((double)num25 <= 6.2831853071795862)
																																																				{
																																																					float num27 = num22 * 0.65f + num22 * (float)(flag ? 0 : 1);
																																																					array[num26] = new PointF(num23 + (float)Math.Cos((double)num25 - 1.5707963267948966) * num27, num24 + (float)Math.Sin((double)num25 - 1.5707963267948966) * num27);
																																																					num25 += 0.628318548f;
																																																					flag = !flag;
																																																					num26++;
																																																				}
																																																				array[num26] = array[0];
																																																				GraphicsPath graphicsPath = new GraphicsPath();
																																																				graphicsPath.AddPolygon(array);
																																																				e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																				this.Draw_NewImage(e);
																																																				graphicsPath.Dispose();
																																																			}
																																																			else
																																																			{
																																																				if (this.TransitionType == ImageTransitionControl.TransitionTypes.Heart)
																																																				{
																																																					this.Draw_CurrentImage(e);
																																																					int num5 = Convert.ToInt32((float)base.Height * this._currentPercentage / 100f);
																																																					int num8 = Convert.ToInt32(base.Width / 2);
																																																					int num9 = Convert.ToInt32(base.Height * 3 / 5);
																																																					int num28 = (int)Math.Sqrt((double)(num5 * num5 * 2));
																																																					int num29 = (num28 - num5) / 2;
																																																					GraphicsPath graphicsPath = new GraphicsPath();
																																																					graphicsPath.AddEllipse(new Rectangle(num8 - num28 + num29, num9 - num28 + num29, num28, num28));
																																																					e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																					graphicsPath.AddEllipse(new Rectangle(num8 - num29, num9 - num28 + num29, num28, num28));
																																																					e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																					graphicsPath.AddPolygon(new Point[]
																																																					{
																																																						new Point(num8, num9 - num5),
																																																						new Point(num8 - num5, num9),
																																																						new Point(num8, num9 + num5),
																																																						new Point(num8 + num5, num9)
																																																					});
																																																					e.Graphics.SetClip(graphicsPath, CombineMode.Union);
																																																					this.Draw_NewImage(e);
																																																					graphicsPath.Dispose();
																																																				}
																																																				else
																																																				{
																																																					if (this.TransitionType == ImageTransitionControl.TransitionTypes.Stretch_H)
																																																					{
																																																						this.Draw_CurrentImage(e);
																																																						ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																						if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																						{
																																																							this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(Convert.ToInt32(((float)base.Width - (float)base.Width * this._currentPercentage / 100f) / 2f), 0, Convert.ToInt32((float)base.Width * this._currentPercentage / 100f), base.ClientRectangle.Height), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																																																						}
																																																						else
																																																						{
																																																							int x = Convert.ToInt32(((float)this._newBackgroundPicture.Width - (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f) / 2f);
																																																							int y = 0;
																																																							int width3 = Convert.ToInt32((float)this._newBackgroundPicture.Width * this._currentPercentage / 100f);
																																																							int height4 = this._newBackgroundPicture.Height;
																																																							Rectangle rectangle = new Rectangle(x, y, width3, height4);
																																																							this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																																																							this.wsg = Graphics.FromImage(this._imageWorkSpace);
																																																							this.wsg.Clear(Color.Transparent);
																																																							this.wsg.DrawImage(this._newBackgroundPicture, rectangle, rectangle, GraphicsUnit.Pixel);
																																																							this.wsg.DrawImage(this._newTextImage, rectangle, 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
																																																							this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
																																																						}
																																																					}
																																																					else
																																																					{
																																																						if (this.TransitionType == ImageTransitionControl.TransitionTypes.Stretch_V)
																																																						{
																																																							this.Draw_CurrentImage(e);
																																																							ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																							if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																							{
																																																								this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(0, Convert.ToInt32(((float)base.Height - (float)base.Height * this._currentPercentage / 100f) / 2f), base.ClientRectangle.Width, Convert.ToInt32((float)base.Height * this._currentPercentage / 100f)), new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), true, null);
																																																							}
																																																							else
																																																							{
																																																								int x = 0;
																																																								int y = Convert.ToInt32(((float)this._newBackgroundPicture.Height - (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f) / 2f);
																																																								int width3 = this._newBackgroundPicture.Width;
																																																								int height4 = Convert.ToInt32((float)this._newBackgroundPicture.Height * this._currentPercentage / 100f);
																																																								Rectangle rectangle = new Rectangle(x, y, width3, height4);
																																																								this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																																																								this.wsg = Graphics.FromImage(this._imageWorkSpace);
																																																								this.wsg.Clear(Color.Transparent);
																																																								this.wsg.DrawImage(this._newBackgroundPicture, rectangle, rectangle, GraphicsUnit.Pixel);
																																																								this.wsg.DrawImage(this._newTextImage, rectangle, 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
																																																								this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
																																																							}
																																																						}
																																																						else
																																																						{
																																																							if (this.TransitionType == ImageTransitionControl.TransitionTypes.Away)
																																																							{
																																																								ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																								if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																								{
																																																									this.Draw_NewImage(e);
																																																									float num10 = 1f - 1f * this._currentPercentage / 100f;
																																																									if (num10 == 0f)
																																																									{
																																																										num10 = 0.01f;
																																																									}
																																																									float dx = (float)(base.Width / 2);
																																																									float num11 = (float)base.Height;
																																																									Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx, num11 * (1f - num10));
																																																									num10 = 1f - 1f * this._currentPercentage / 100f;
																																																									if (num10 == 0f)
																																																									{
																																																										num10 = 0.01f;
																																																									}
																																																									dx = (float)(base.Width / 2);
																																																									num11 = (float)base.Height;
																																																									matrix = new Matrix(num10, 0f, 0f, num10, dx, num11 * (1f - num10));
																																																									e.Graphics.Transform = matrix;
																																																									if (this.TransitBackPictureAction == ImageTransitionControl.BackPicturesTransition.NewOnly)
																																																									{
																																																										this.DrawImageToOutput(e, this._currentTextImage, new Rectangle(-base.Width / 2, -1 - base.Height / 20, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null, ImageTransitionControl.PanelType.CurrentWithTrans);
																																																									}
																																																									else
																																																									{
																																																										this.DrawImageToOutput(e, this._currentCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 20, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																									}
																																																									matrix.Dispose();
																																																								}
																																																								else
																																																								{
																																																									this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), false, null);
																																																									ImageAttributes imageAttributes = new ImageAttributes();
																																																									imageAttributes.SetColorMatrix(new ColorMatrix
																																																									{
																																																										Matrix33 = 0.003921569f * (255f * (1f - this._currentPercentage / 100f))
																																																									});
																																																									float dx = (float)(base.Width / 2);
																																																									float num11 = (float)base.Height;
																																																									float num10 = 1f - 1f * this._currentPercentage / 100f;
																																																									if (num10 == 0f)
																																																									{
																																																										num10 = 0.01f;
																																																									}
																																																									Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx, (float)base.Height * (1f - num10));
																																																									e.Graphics.Transform = matrix2;
																																																									this.DrawImageToOutput(e, this._currentTextImage, new Rectangle(-base.Width / 2, 0, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, imageAttributes, ImageTransitionControl.PanelType.CurrentWithTrans);
																																																									imageAttributes.Dispose();
																																																									matrix2.Dispose();
																																																								}
																																																							}
																																																							else
																																																							{
																																																								if (this.TransitionType == ImageTransitionControl.TransitionTypes.Zoom_Away)
																																																								{
																																																									ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																									if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																									{
																																																										this.DrawDefaultBackPattern(e);
																																																										float dx = (float)(base.Width / 2);
																																																										float num11 = (float)(base.Height / 3);
																																																										float num10 = 0.2f + 0.8f * this._currentPercentage / 100f;
																																																										if (num10 == 0f)
																																																										{
																																																											num10 = 0.01f;
																																																										}
																																																										Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx, num11);
																																																										e.Graphics.Transform = matrix;
																																																										if (this.TransitBackPictureAction == ImageTransitionControl.BackPicturesTransition.CurrentOnly)
																																																										{
																																																											this.DrawImageToOutput(e, this._newTextImage, new Rectangle(-base.Width / 2, -1 - base.Height / 3, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, null);
																																																										}
																																																										else
																																																										{
																																																											this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 3, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, null);
																																																										}
																																																										num10 = 1f - 1f * this._currentPercentage / 100f;
																																																										if (num10 == 0f)
																																																										{
																																																											num10 = 0.01f;
																																																										}
																																																										dx = (float)(base.Width / 2);
																																																										num11 = (float)base.Height;
																																																										matrix = new Matrix(num10, 0f, 0f, num10, dx, num11 * (1f - num10));
																																																										e.Graphics.Transform = matrix;
																																																										if (this.TransitBackPictureAction == ImageTransitionControl.BackPicturesTransition.NewOnly)
																																																										{
																																																											this.DrawImageToOutput(e, this._currentTextImage, new Rectangle(-base.Width / 2, -1 - base.Height / 20, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null, ImageTransitionControl.PanelType.Current);
																																																										}
																																																										else
																																																										{
																																																											this.DrawImageToOutput(e, this._currentCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 20, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																										}
																																																										matrix.Dispose();
																																																									}
																																																									else
																																																									{
																																																										this.DrawImageToOutput(e, this._newBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), false, null);
																																																										ImageAttributes imageAttributes = new ImageAttributes();
																																																										imageAttributes.SetColorMatrix(new ColorMatrix
																																																										{
																																																											Matrix33 = 0.003921569f * (255f * (1f - this._currentPercentage / 100f))
																																																										});
																																																										float dx = (float)(base.Width / 2);
																																																										float num11 = (float)base.Height;
																																																										float num10 = 1f - 1f * this._currentPercentage / 100f;
																																																										if (num10 == 0f)
																																																										{
																																																											num10 = 0.01f;
																																																										}
																																																										Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx, (float)base.Height * (1f - num10));
																																																										e.Graphics.Transform = matrix2;
																																																										this.DrawImageToOutput(e, this._currentTextImage, new Rectangle(-base.Width / 2, 0, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, imageAttributes, ImageTransitionControl.PanelType.Current);
																																																										imageAttributes.Dispose();
																																																										dx = (float)(base.Width / 2);
																																																										num11 = (float)(base.Height / 3);
																																																										num10 = 0.2f + 0.8f * this._currentPercentage / 100f;
																																																										if (num10 == 0f)
																																																										{
																																																											num10 = 0.01f;
																																																										}
																																																										matrix2 = new Matrix(num10, 0f, 0f, num10, dx, num11);
																																																										e.Graphics.Transform = matrix2;
																																																										this.DrawImageToOutput(e, this._newTextImage, new Rectangle(-base.Width / 2, -1 - base.Height / 3, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null, ImageTransitionControl.PanelType.New);
																																																										matrix2.Dispose();
																																																									}
																																																								}
																																																								else
																																																								{
																																																									if (this.TransitionType == ImageTransitionControl.TransitionTypes.CircularWipe)
																																																									{
																																																										this.Draw_CurrentImage(e);
																																																										float num14 = 360f * this._currentPercentage / 100f;
																																																										float num30 = (float)base.Width * 1.414f;
																																																										GraphicsPath graphicsPath = new GraphicsPath();
																																																										graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 180f, num14);
																																																										e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																										this.Draw_NewImage(e);
																																																										graphicsPath.Dispose();
																																																									}
																																																									else
																																																									{
																																																										if (this.TransitionType == ImageTransitionControl.TransitionTypes.Wedge)
																																																										{
																																																											this.Draw_CurrentImage(e);
																																																											float num14 = 360f * this._currentPercentage / 100f;
																																																											float num30 = (float)base.Width * 1.414f;
																																																											GraphicsPath graphicsPath = new GraphicsPath();
																																																											graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 270f - num14 / 2f, num14);
																																																											e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																											this.Draw_NewImage(e);
																																																											graphicsPath.Dispose();
																																																										}
																																																										else
																																																										{
																																																											if (this.TransitionType == ImageTransitionControl.TransitionTypes.BowTie)
																																																											{
																																																												this.Draw_CurrentImage(e);
																																																												float num14 = 180f * this._currentPercentage / 100f;
																																																												float num30 = (float)base.Width * 1.414f;
																																																												GraphicsPath graphicsPath = new GraphicsPath();
																																																												graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 270f - num14 / 2f, num14);
																																																												graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 90f - num14 / 2f, num14);
																																																												e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																												this.Draw_NewImage(e);
																																																												graphicsPath.Dispose();
																																																											}
																																																											else
																																																											{
																																																												if (this.TransitionType == ImageTransitionControl.TransitionTypes.FanUp)
																																																												{
																																																													this.Draw_CurrentImage(e);
																																																													float num14 = 150f * this._currentPercentage / 100f;
																																																													float num30 = (float)base.Width * 1.7f * 1.414f;
																																																													GraphicsPath graphicsPath = new GraphicsPath();
																																																													graphicsPath.AddPie(((float)base.Width - num30) / 2f, (float)base.Height - num30 * 0.9f, num30, num30, 90f - num14 / 2f, num14);
																																																													e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																													this.Draw_NewImage(e);
																																																													graphicsPath.Dispose();
																																																												}
																																																												else
																																																												{
																																																													if (this.TransitionType == ImageTransitionControl.TransitionTypes.WindMill)
																																																													{
																																																														this.Draw_CurrentImage(e);
																																																														float num14 = 90f * this._currentPercentage / 100f;
																																																														float num30 = (float)base.Width * 1.414f;
																																																														GraphicsPath graphicsPath = new GraphicsPath();
																																																														graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 270f, num14);
																																																														graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 0f, num14);
																																																														graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 90f, num14);
																																																														graphicsPath.AddPie(((float)base.Width - num30) / 2f, ((float)base.Height - num30) / 2f, num30, num30, 180f, num14);
																																																														e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																														this.Draw_NewImage(e);
																																																														graphicsPath.Dispose();
																																																													}
																																																													else
																																																													{
																																																														if (this.TransitionType == ImageTransitionControl.TransitionTypes.RandomBars)
																																																														{
																																																															this.Draw_CurrentImage(e);
																																																															GraphicsPath graphicsPath = new GraphicsPath();
																																																															Random random = new Random();
																																																															int num31 = base.Height / 2 + 1;
																																																															int num32 = (int)((float)num31 * this._currentPercentage / 100f) - this.TotalBitsArraySet;
																																																															for (int k = 0; k < num32 - 1; k++)
																																																															{
																																																																int num33 = random.Next(num31);
																																																																while (this.BitsArray[num33])
																																																																{
																																																																	num33++;
																																																																	if (num33 > base.Height)
																																																																	{
																																																																		num33 = 0;
																																																																	}
																																																																}
																																																																this.BitsArray[num33] = true;
																																																															}
																																																															this.TotalBitsArraySet = 0;
																																																															int width5 = base.Width;
																																																															for (int k = 0; k <= num31; k++)
																																																															{
																																																																if (this.BitsArray[k])
																																																																{
																																																																	this.TotalBitsArraySet++;
																																																																	graphicsPath.AddRectangle(new Rectangle(0, k * 2, width5, 2));
																																																																}
																																																															}
																																																															e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																															this.Draw_NewImage(e);
																																																															graphicsPath.Dispose();
																																																														}
																																																														else
																																																														{
																																																															if (this.TransitionType == ImageTransitionControl.TransitionTypes.Dissolve)
																																																															{
																																																																this.Draw_CurrentImage(e);
																																																																GraphicsPath graphicsPath = new GraphicsPath();
																																																																Random random = new Random();
																																																																int num34 = (int)((float)this.DissolveTotal * this._currentPercentage / 100f) - this.TotalBitsArraySet;
																																																																for (int k = 0; k < num34 - 1; k++)
																																																																{
																																																																	int num35 = random.Next(this.DissolveTotal);
																																																																	this.BitsArray[num35] = true;
																																																																}
																																																																this.TotalBitsArraySet = 0;
																																																																for (int k = 0; k < this.DissolveTotal; k++)
																																																																{
																																																																	if (this.BitsArray[k])
																																																																	{
																																																																		int num36 = k / this.DissolveCountX;
																																																																		int num37 = k - num36 * this.DissolveCountX - 1;
																																																																		this.TotalBitsArraySet++;
																																																																		graphicsPath.AddRectangle(new Rectangle(num37 * this.DissolveSize, num36 * this.DissolveSize, this.DissolveSize, this.DissolveSize));
																																																																	}
																																																																}
																																																																e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																																this.Draw_NewImage(e);
																																																																graphicsPath.Dispose();
																																																															}
																																																															else
																																																															{
																																																																if (this.TransitionType == ImageTransitionControl.TransitionTypes.Mosaic)
																																																																{
																																																																	this.Draw_CurrentImage(e);
																																																																	GraphicsPath graphicsPath = new GraphicsPath();
																																																																	Random random = new Random();
																																																																	int num34 = (int)((float)this.DissolveTotal * this._currentPercentage / 100f) - this.TotalBitsArraySet;
																																																																	for (int k = 0; k < num34 - 1; k++)
																																																																	{
																																																																		int num35 = random.Next(this.DissolveTotal);
																																																																		while (this.BitsArray[num35])
																																																																		{
																																																																			num35++;
																																																																			if (num35 > this.DissolveTotal)
																																																																			{
																																																																				num35 = 0;
																																																																			}
																																																																		}
																																																																		this.BitsArray[num35] = true;
																																																																	}
																																																																	this.TotalBitsArraySet = 0;
																																																																	for (int k = 0; k < this.DissolveTotal; k++)
																																																																	{
																																																																		if (this.BitsArray[k])
																																																																		{
																																																																			int num36 = k / this.DissolveCountX;
																																																																			int num37 = k - num36 * this.DissolveCountX - 1;
																																																																			this.TotalBitsArraySet++;
																																																																			graphicsPath.AddRectangle(new Rectangle(num37 * this.DissolveSize, num36 * this.DissolveSize, this.DissolveSize, this.DissolveSize));
																																																																		}
																																																																	}
																																																																	e.Graphics.SetClip(graphicsPath, CombineMode.Replace);
																																																																	this.Draw_NewImage(e);
																																																																	graphicsPath.Dispose();
																																																																}
																																																																else
																																																																{
																																																																	if (this.TransitionType == ImageTransitionControl.TransitionTypes.Zoom_In)
																																																																	{
																																																																		this.Draw_CurrentImage(e);
																																																																		float num10 = 0.2f + 0.8f * this._currentPercentage / 100f;
																																																																		if (num10 == 0f)
																																																																		{
																																																																			num10 = 0.01f;
																																																																		}
																																																																		ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																																		if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																																		{
																																																																			float dx = (float)(base.Width / 2);
																																																																			float num11 = (float)(base.Height / 2);
																																																																			Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx, num11);
																																																																			e.Graphics.Transform = matrix;
																																																																			this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																																			matrix.Dispose();
																																																																		}
																																																																		else
																																																																		{
																																																																			num10 = (this._currentPercentage + 20f) / 100f;
																																																																			if (num10 == 0f)
																																																																			{
																																																																				num10 = 0.01f;
																																																																			}
																																																																			else
																																																																			{
																																																																				if (num10 > 1f)
																																																																				{
																																																																					num10 = 1f;
																																																																				}
																																																																			}
																																																																			float dx = (float)(this._newBackgroundPicture.Width / 2);
																																																																			float num11 = (float)(this._newBackgroundPicture.Height / 2);
																																																																			this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																																																																			this.wsg = Graphics.FromImage(this._imageWorkSpace);
																																																																			this.wsg.Clear(Color.Transparent);
																																																																			Rectangle rectangle = new Rectangle(-this._newBackgroundPicture.Width / 2, -1 - this._newBackgroundPicture.Height / 2, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
																																																																			Rectangle rectangle2 = new Rectangle(rectangle.Width / 2 - (int)(num10 * (float)rectangle.Width / 2f), rectangle.Height / 2 - (int)(num10 * (float)rectangle.Height / 2f), (int)(num10 * (float)rectangle.Width), (int)(num10 * (float)rectangle.Height));
																																																																			this.wsg.DrawImage(this._newBackgroundPicture, rectangle2, rectangle2, GraphicsUnit.Pixel);
																																																																			Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx, num11);
																																																																			this.wsg.Transform = matrix2;
																																																																			this.wsg.DrawImage(this._newTextImage, rectangle, 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
																																																																			this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
																																																																			matrix2.Dispose();
																																																																		}
																																																																	}
																																																																	else
																																																																	{
																																																																		if (this.TransitionType == ImageTransitionControl.TransitionTypes.Zoom_Out)
																																																																		{
																																																																			float num10 = 2f - this._currentPercentage / 100f;
																																																																			if (num10 == 0f)
																																																																			{
																																																																				num10 = 0.01f;
																																																																			}
																																																																			ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
																																																																			if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
																																																																			{
																																																																				float dx = (float)(base.Width / 2);
																																																																				float num11 = (float)(base.Height / 2);
																																																																				Matrix matrix = new Matrix(num10, 0f, 0f, num10, dx, num11 * num10);
																																																																				e.Graphics.Transform = matrix;
																																																																				this.DrawImageToOutput(e, this._newCombinedImage, new Rectangle(-base.Width / 2, -1 - base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
																																																																				matrix.Dispose();
																																																																			}
																																																																			else
																																																																			{
																																																																				this.DrawImageToOutput(e, this._newBackgroundPicture, base.ClientRectangle, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), false, null);
																																																																				float dx = (float)(base.Width / 2);
																																																																				float num11 = (float)(base.Height / 2);
																																																																				Matrix matrix2 = new Matrix(num10, 0f, 0f, num10, dx, num11 * num10);
																																																																				e.Graphics.Transform = matrix2;
																																																																				this.DrawImageToOutput(e, this._newTextImage, new Rectangle(-base.Width / 2, -1 - base.Height / 2, base.Width, base.Height), new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null, ImageTransitionControl.PanelType.Current);
																																																																				matrix2.Dispose();
																																																																			}
																																																																		}
																																																																	}
																																																																}
																																																															}
																																																														}
																																																													}
																																																												}
																																																											}
																																																										}
																																																									}
																																																								}
																																																							}
																																																						}
																																																					}
																																																				}
																																																			}
																																																		}
																																																	}
																																																}
																																															}
																																														}
																																													}
																																												}
																																											}
																																										}
																																									}
																																								}
																																							}
																																						}
																																					}
																																				}
																																			}
																																		}
																																	}
																																}
																															}
																														}
																													}
																												}
																											}
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
					if (this.AlertOverallCurrentPercentage < 100f)
					{
						this.AddAlertTextToImage(e);
					}
					if (this.RefOverallCurrentPercentage < 100f)
					{
						this.AddRefTextToImage(e);
					}
				}
				else
				{
					if (this.t != null)
					{
						this.t.Dispose();
					}
					this.t = null;
					if (this.ItemFirstShowing)
					{
						this.RefGo();
						this.ItemFirstShowing = false;
					}
					this._transitionType = this._previousTransitionType;
					if (this.AlertRunning || this.RefRunning)
					{
						if (this.AlertOverallCurrentPercentage >= 100f)
						{
							this.AlertRunning = false;
							if (this.ta != null)
							{
								this.ta.Dispose();
							}
							this.ta = null;
						}
						if (this.RefOverallCurrentPercentage >= 100f)
						{
							this.RefRunning = false;
							if (this.tr != null)
							{
								this.tr.Dispose();
							}
							this.tr = null;
						}
					}
					this.ReLoadNewImage(e);
					this.AddAlertTextToImage(e);
					this.AddRefTextToImage(e);
				}
				base.OnPaint(e);
			}
		}
		private void ReLoadNewImage(PaintEventArgs e)
		{
			this.DrawImageToOutputBitBlt(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), false, null, ImageTransitionControl.PanelType.NoAction);
		}
		private void Draw_CurrentImage(PaintEventArgs e)
		{
			if (this._currentPercentage < 100f)
			{
				this.DrawImageToOutput(e, this._currentCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._currentCombinedImage.Width, this._currentCombinedImage.Height), false, null);
			}
			this.AddAlertTextToImage(e);
			this.AddRefTextToImage(e);
		}
		private void Draw_NewImage(PaintEventArgs e)
		{
			this.DrawImageToOutput(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null);
		}
		private void Draw_NewImageBitBlt(PaintEventArgs e)
		{
			this.DrawImageToOutputBitBlt(e, this._newCombinedImage, base.ClientRectangle, new Rectangle(0, 0, this._newCombinedImage.Width, this._newCombinedImage.Height), true, null, ImageTransitionControl.PanelType.NoAction);
		}
		private void DrawImageToOutput(PaintEventArgs e, Image InImage, Rectangle DestinationRectangle, Rectangle SourceRectangle, bool DrawAlert, ImageAttributes InImageAttributes)
		{
			this.DrawImageToOutput(e, InImage, DestinationRectangle, SourceRectangle, DrawAlert, InImageAttributes, ImageTransitionControl.PanelType.NoAction);
		}
		private void DrawImageToOutput(PaintEventArgs e, Image InImage, Rectangle DestinationRectangle, Rectangle SourceRectangle, bool DrawAlert, ImageAttributes InImageAttributes, ImageTransitionControl.PanelType InPanelType)
		{
			this.DrawImageToOutputNormal(e, InImage, DestinationRectangle, SourceRectangle, DrawAlert, InImageAttributes, InPanelType);
		}
		private void DrawImageToOutputNormal(PaintEventArgs e, Image InImage, Rectangle DestinationRectangle, Rectangle SourceRectangle, bool DrawAlert, ImageAttributes InImageAttributes, ImageTransitionControl.PanelType InPanelType)
		{
			if (InImageAttributes == null)
			{
				e.Graphics.DrawImage(InImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
				switch (InPanelType)
				{
				case ImageTransitionControl.PanelType.Current:
					e.Graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, new Rectangle(0, 0, SourceRectangle.Width, SourceRectangle.Height), GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.CurrentWithTrans:
					e.Graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.New:
					e.Graphics.DrawImage(this.NewPanelImage, DestinationRectangle, new Rectangle(0, 0, SourceRectangle.Width, SourceRectangle.Height), GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.NewWithTrans:
					e.Graphics.DrawImage(this.NewPanelImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
					break;
				}
			}
			else
			{
				e.Graphics.DrawImage(InImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
				switch (InPanelType)
				{
				case ImageTransitionControl.PanelType.Current:
					e.Graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, 0, 0, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.CurrentWithTrans:
					e.Graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.New:
					e.Graphics.DrawImage(this.NewPanelImage, DestinationRectangle, 0, 0, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.NewWithTrans:
					e.Graphics.DrawImage(this.NewPanelImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				}
			}
		}
		private void DrawImageToOutputBitBlt(PaintEventArgs e, Image InImage, Rectangle DestinationRectangle, Rectangle SourceRectangle, bool DrawAlert, ImageAttributes InImageAttributes, ImageTransitionControl.PanelType InPanelType)
		{
			IntPtr hdc = e.Graphics.GetHdc();
			IntPtr intPtr = gf.CreateCompatibleDC(hdc);
			IntPtr intPtr2 = gf.CreateCompatibleBitmap(hdc, DestinationRectangle.Width, DestinationRectangle.Height);
			gf.SelectObject(intPtr, intPtr2);
			Graphics graphics = Graphics.FromHdc(intPtr);
			if (InImageAttributes == null)
			{
				graphics.DrawImage(InImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
				switch (InPanelType)
				{
				case ImageTransitionControl.PanelType.Current:
					graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, new Rectangle(0, 0, SourceRectangle.Width, SourceRectangle.Height), GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.CurrentWithTrans:
					graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.New:
					graphics.DrawImage(this.NewPanelImage, DestinationRectangle, new Rectangle(0, 0, SourceRectangle.Width, SourceRectangle.Height), GraphicsUnit.Pixel);
					break;
				case ImageTransitionControl.PanelType.NewWithTrans:
					graphics.DrawImage(this.NewPanelImage, DestinationRectangle, SourceRectangle, GraphicsUnit.Pixel);
					break;
				}
			}
			else
			{
				graphics.DrawImage(InImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
				switch (InPanelType)
				{
				case ImageTransitionControl.PanelType.Current:
					graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, 0, 0, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.CurrentWithTrans:
					graphics.DrawImage(this.CurrentPanelImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.New:
					graphics.DrawImage(this.NewPanelImage, DestinationRectangle, 0, 0, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				case ImageTransitionControl.PanelType.NewWithTrans:
					graphics.DrawImage(this.NewPanelImage, DestinationRectangle, SourceRectangle.Left, SourceRectangle.Top, SourceRectangle.Width, SourceRectangle.Height, GraphicsUnit.Pixel, InImageAttributes);
					break;
				}
			}
			IntPtr hdc2 = graphics.GetHdc();
			gf.BitBlt(hdc, 0, 0, DestinationRectangle.Width, DestinationRectangle.Height, hdc2, 0, 0, 13369376);
			graphics.ReleaseHdc(hdc2);
			gf.DeleteDC(intPtr);
			gf.DeleteObject(intPtr);
			gf.DeleteObject(intPtr2);
			e.Graphics.ReleaseHdc(hdc);
			graphics.Dispose();
			GC.Collect();
		}
		private void Draw_TranSlideIn(PaintEventArgs e, ImageTransitionControl.TransitionTypes InTransType)
		{
			this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
			this.wsg = Graphics.FromImage(this._imageWorkSpace);
			this.wsg.Clear(Color.Transparent);
			float num = 0f;
			float num2 = 0f;
			Matrix transform = new Matrix(1f, 0f, 0f, 1f, 0f, 1f);
			switch (InTransType)
			{
			case ImageTransitionControl.TransitionTypes.InTop:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Height;
				transform = new Matrix(1f, 0f, 0f, 1f, 0f, num);
				break;
			case ImageTransitionControl.TransitionTypes.InLeft:
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Width;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, 0f);
				break;
			case ImageTransitionControl.TransitionTypes.InRight:
				num2 = (float)this._newBackgroundPicture.Width - (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, 0f);
				break;
			case ImageTransitionControl.TransitionTypes.InBottom:
				num = (float)this._newBackgroundPicture.Height - (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, 0f, num);
				break;
			case ImageTransitionControl.TransitionTypes.InTopLeft:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Height;
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Width;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.InTopRight:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Height;
				num2 = (float)this._newBackgroundPicture.Width - (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.InBottomLeft:
				num = (float)this._newBackgroundPicture.Height - (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f - (float)this._newBackgroundPicture.Width;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.InBottomRight:
				num = (float)this._newBackgroundPicture.Height - (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				num2 = (float)this._newBackgroundPicture.Width - (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			}
			ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
			if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
			{
				this.Draw_CurrentImage(e);
				e.Graphics.Transform = transform;
				this.Draw_NewImage(e);
			}
			else
			{
				int x = (num2 >= 0f) ? ((int)num2) : 0;
				int y = (num >= 0f) ? ((int)num) : 0;
				int width = (num2 >= 0f) ? (this._newBackgroundPicture.Width - (int)num2) : (this._newBackgroundPicture.Width + (int)num2);
				int height = (num >= 0f) ? (this._newBackgroundPicture.Height - (int)num) : (this._newBackgroundPicture.Height + (int)num);
				Rectangle rectangle = new Rectangle(x, y, width, height);
				this.wsg.DrawImage(this._currentCombinedImage, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
				this.wsg.DrawImage(this._newBackgroundPicture, rectangle, rectangle, GraphicsUnit.Pixel);
				this.wsg.DrawImage(this._newTextImage, new Rectangle((int)num2, (int)num, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
				this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.New);
			}
		}
		private void Draw_TranSlideOut(PaintEventArgs e, ImageTransitionControl.TransitionTypes InTransType)
		{
			this._imageWorkSpace = new Bitmap(this._newBackgroundPicture.Width, this._newBackgroundPicture.Height);
			this.wsg = Graphics.FromImage(this._imageWorkSpace);
			this.wsg.Clear(Color.Transparent);
			float num = 0f;
			float num2 = 0f;
			Matrix transform = new Matrix(1f, 0f, 0f, 1f, 0f, 1f);
			switch (InTransType)
			{
			case ImageTransitionControl.TransitionTypes.OutTop:
				num = (float)(-(float)this._newBackgroundPicture.Height) * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, 0f, num);
				break;
			case ImageTransitionControl.TransitionTypes.OutLeft:
				num2 = (float)(-(float)this._newBackgroundPicture.Width) * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, 0f);
				break;
			case ImageTransitionControl.TransitionTypes.OutRight:
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, 0f);
				break;
			case ImageTransitionControl.TransitionTypes.OutBottom:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, 0f, num);
				break;
			case ImageTransitionControl.TransitionTypes.OutTopLeft:
				num = (float)(-(float)this._newBackgroundPicture.Height) * this._currentPercentage / 100f;
				num2 = (float)(-(float)this._newBackgroundPicture.Width) * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.OutTopRight:
				num = (float)(-(float)this._newBackgroundPicture.Height) * this._currentPercentage / 100f;
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.OutBottomLeft:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				num2 = (float)(-(float)this._newBackgroundPicture.Width) * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			case ImageTransitionControl.TransitionTypes.OutBottomRight:
				num = (float)this._newBackgroundPicture.Height * this._currentPercentage / 100f;
				num2 = (float)this._newBackgroundPicture.Width * this._currentPercentage / 100f;
				transform = new Matrix(1f, 0f, 0f, 1f, num2, num);
				break;
			}
			ImageTransitionControl.BackPicturesTransition transitBackPictureAction = this.TransitBackPictureAction;
			if (transitBackPictureAction != ImageTransitionControl.BackPicturesTransition.None)
			{
				this.Draw_NewImage(e);
				e.Graphics.Transform = transform;
				this.Draw_CurrentImage(e);
			}
			else
			{
				int x = (num2 >= 0f) ? ((int)num2) : 0;
				int y = (num >= 0f) ? ((int)num) : 0;
				int width = (num2 >= 0f) ? (this._newBackgroundPicture.Width - (int)num2) : (this._newBackgroundPicture.Width + (int)num2);
				int height = (num >= 0f) ? (this._newBackgroundPicture.Height - (int)num) : (this._newBackgroundPicture.Height + (int)num);
				Rectangle rectangle = new Rectangle(x, y, width, height);
				this.wsg.DrawImage(this.NewCombinedImage, new Rectangle(0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
				this.wsg.DrawImage(this._newBackgroundPicture, rectangle, rectangle, GraphicsUnit.Pixel);
				this.wsg.DrawImage(this._currentTextImage, new Rectangle((int)num2, (int)num, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height), 0, 0, this._newBackgroundPicture.Width, this._newBackgroundPicture.Height, GraphicsUnit.Pixel);
				this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null, ImageTransitionControl.PanelType.Current);
			}
		}
		private void Draw_TranSlideReveal(PaintEventArgs e, ImageTransitionControl.TransitionTypes InTransType)
		{
			this._imageWorkSpace = new Bitmap(this.NewCombinedImage.Width, this.NewCombinedImage.Height);
			this.wsg = Graphics.FromImage(this._imageWorkSpace);
			this.wsg.DrawImage(this.NewCombinedImage, new Rectangle(0, 0, this.NewCombinedImage.Width, this.NewCombinedImage.Height), 0, 0, this.NewCombinedImage.Width, this.NewCombinedImage.Height, GraphicsUnit.Pixel);
			int num = 0;
			int num2 = 0;
			int width = this.NewCombinedImage.Width;
			int height = this.NewCombinedImage.Height;
			float num3 = 1f * this._currentPercentage / 100f;
			switch (InTransType)
			{
			case ImageTransitionControl.TransitionTypes.RevealTopDown:
				num2 = (int)((float)this._currentCombinedImage.Height * num3);
				height = this._currentCombinedImage.Height - num2;
				break;
			case ImageTransitionControl.TransitionTypes.RevealLeftRight:
				num = (int)((float)this._currentCombinedImage.Width * num3);
				width = this._currentCombinedImage.Width - num;
				break;
			case ImageTransitionControl.TransitionTypes.RevealRightLeft:
				width = (int)((float)this._currentCombinedImage.Width * (1f - num3));
				break;
			case ImageTransitionControl.TransitionTypes.RevealDownUp:
				height = (int)((float)this._currentCombinedImage.Height * (1f - num3));
				break;
			}
			Rectangle rectangle = new Rectangle(num, num2, width, height);
			this.wsg.DrawImage(this._currentCombinedImage, rectangle, rectangle, GraphicsUnit.Pixel);
			this.DrawImageToOutput(e, this._imageWorkSpace, base.ClientRectangle, new Rectangle(0, 0, this._imageWorkSpace.Width, this._imageWorkSpace.Height), true, null);
		}
		private void AlertTick(object state)
		{
			if (!gf.ParentalAlertLive & !gf.MessageAlertLive)
			{
				this.StopAlert();
			}
			TimeSpan timeSpan = DateTime.Now.Subtract(this.AlertStartTime);
			this.AlertOverallCurrentPercentage = Convert.ToSingle(100.0 / this._alertTransitionTime.TotalSeconds * timeSpan.TotalSeconds);
			if (this.AlertOverallCurrentPercentage > 100f)
			{
				this.AlertOverallCurrentPercentage = 100f;
			}
			TimeSpan timeSpan2 = DateTime.Now.Subtract(this.AlertMessageStartTime);
			this.AlertMessagePercentage = Convert.ToSingle(100.0 / this._alertMessageTransitionTime.TotalSeconds * timeSpan2.TotalSeconds);
			if (this.AlertMessagePercentage > 100f)
			{
				this.AlertMessagePercentage = 100f;
			}
			base.Invalidate();
		}
		public void StartAlert(gf.SongSettings InItem, string InString, int InDuration, Font InFont, bool InUseScroll, bool InUseFlash, bool InTransparent, bool InUseShadow, bool InUseOutline, Color InTextColour, Color InBackColour, int InAlignment, int InVerticalAlignment, double BottomBorderFactor)
		{
			if (this._newBackgroundPicture != null)
			{
				int num = this._newBackgroundPicture.Width;
				int num2 = (int)(gf.MinBottomBorderFactor * (double)this._newBackgroundPicture.Height * 1.2);
				if (num < 1)
				{
					num = 1;
				}
				if (num2 < 1)
				{
					num2 = 1;
				}
				this.AlertAlign = InAlignment;
				this.AlertScroll = InUseScroll;
				this.AlertFlash = InUseFlash;
				this.AlertTransparent = InTransparent;
				this.AlertimageBackground = new Bitmap(num, num2 + 6);
				this.alertg = Graphics.FromImage(this.AlertimageBackground);
				this.alertg.Clear(Color.Transparent);
				this.AlertimageBackground_Inverse = new Bitmap(num, num2 + 6);
				this.alertg_Inverse = Graphics.FromImage(this.AlertimageBackground_Inverse);
				this.alertg_Inverse.Clear(Color.Transparent);
				this.AlertBorder = num / 20;
				InFont = new Font(InFont.Name, InFont.Size - 1f, InFont.Style);
				int num3 = (int)((double)gf.ReduceFontToFit(this.alertg, InString, ref InFont, num - this.AlertBorder * 2, num2 - 2) * 1.1);
				this.AlertMessageBackGroundRect = new Rectangle(0, 0, (int)this.alertg.MeasureString(InString, InFont).Width, num3);
				num2 = num3 + 4;
				this.AlertimageMessage = new Bitmap(this.AlertMessageBackGroundRect.Width, num2);
				this.alertMessageg = Graphics.FromImage(this.AlertimageMessage);
				this.alertMessageg.Clear(this.AlertTransparent ? Color.Transparent : InBackColour);
				this.AlertimageMessage_Inverse = new Bitmap(this.AlertMessageBackGroundRect.Width, num2);
				this.alertMessageg_Inverse = Graphics.FromImage(this.AlertimageMessage_Inverse);
				this.alertMessageg_Inverse.Clear(this.AlertTransparent ? Color.Transparent : InBackColour);
				gf.OutputOneLineToScreen(InItem, InString, InFont, this.alertMessageg, InTextColour, StringAlignment.Center, InUseShadow ? 1 : 0, InUseOutline ? 1 : 0, 0, (num2 - this.AlertMessageBackGroundRect.Height) / 2, this.AlertMessageBackGroundRect.Width, 0);
				Rectangle rectangle = default(Rectangle);
				rectangle.Y = ((InVerticalAlignment == 0) ? 0 : (this._newBackgroundPicture.Height - num2));
				rectangle.Height = num2;
				if (this.AlertAlign == 3)
				{
					rectangle.X = num - (this.AlertMessageBackGroundRect.Width + this.AlertBorder * 2);
					rectangle.Width = this.AlertMessageBackGroundRect.Width + this.AlertBorder * 2;
					this.AlertMessageOriginX = rectangle.X + this.AlertMessageBackGroundRect.Width + this.AlertBorder / 2;
				}
				else
				{
					if (this.AlertAlign == 1)
					{
						rectangle.X = 0;
						rectangle.Width = this.AlertMessageBackGroundRect.Width + this.AlertBorder * 2;
						this.AlertMessageOriginX = rectangle.X + this.AlertMessageBackGroundRect.Width + this.AlertBorder;
					}
					else
					{
						rectangle.X = 0;
						rectangle.Width = this._newBackgroundPicture.Width;
						this.AlertMessageOriginX = (this._newBackgroundPicture.Width - this.AlertMessageBackGroundRect.Width) / 2 + this.AlertMessageBackGroundRect.Width + this.AlertBorder / 2;
					}
				}
				this.AlertMessageOriginY = rectangle.Top + 1;
				this.AlertOriginY = rectangle.Top;
				this.AlertOverallBackGroundRect = new Rectangle(0, 0, num, rectangle.Height);
				this.alertg.FillRectangle(new SolidBrush(this.AlertTransparent ? Color.Transparent : InBackColour), rectangle.X, 0, rectangle.Width, rectangle.Height);
				this.alertg_Inverse.FillRectangle(new SolidBrush(this.AlertTransparent ? Color.Transparent : InBackColour), rectangle.X, 0, rectangle.Width, rectangle.Height);
				this.AlertTransitionTime = (float)InDuration;
				float alertMessageTransitionTime = this.AlertMessageTransitionTime;
				this.AlertComputeOccurences(InString, this.AlertTransitionTime, ref alertMessageTransitionTime, ref this.AlertOccurences);
				this.AlertMessageTransitionTime = alertMessageTransitionTime;
				this.AlertGapRunning = false;
				this.AlertOverallCurrentPercentage = 0f;
				this.AlertMessagePercentage = 0f;
				this.AlertRunning = true;
				this.AlertStartTime = DateTime.Now;
				this.AlertMessageStartTime = DateTime.Now;
				base.Invalidate();
				this.ta = new System.Threading.Timer(new TimerCallback(this.AlertTick), null, 150, 150);
			}
		}
		private void AlertComputeOccurences(string InString, float OverallDurationTime, ref float MessageDuration, ref int Occurences)
		{
			this.AlertCharPerSecond = 6f;
			int num = (int)((float)InString.Length / this.AlertCharPerSecond) + this.AlertGapDuration;
			if ((float)num > OverallDurationTime)
			{
				this.AlertCharPerSecond = (float)InString.Length / (OverallDurationTime - (float)this.AlertGapDuration);
				Occurences = 1;
			}
			else
			{
				Occurences = (int)(OverallDurationTime / (float)num);
				if (Occurences == 0)
				{
					Occurences = 1;
				}
			}
			MessageDuration = (float)InString.Length / this.AlertCharPerSecond;
			if (MessageDuration < 0f)
			{
				MessageDuration = OverallDurationTime;
			}
		}
		private void AddAlertTextToImage(PaintEventArgs e)
		{
			if (this.AlertRunning && this.AlertimageMessage != null)
			{
				float num = (float)base.ClientRectangle.Width / (float)this._newBackgroundPicture.Width;
				float num2 = (float)base.ClientRectangle.Height / (float)this._newBackgroundPicture.Height;
				Rectangle destRect = default(Rectangle);
				e.Graphics.ResetTransform();
				if (this.AlertMessagePercentage < 100f)
				{
					destRect = new Rectangle(0, (int)((float)this.AlertOriginY * num2), (int)((float)this.AlertOverallBackGroundRect.Width * num), (int)((float)this.AlertOverallBackGroundRect.Height * num2));
					e.Graphics.DrawImage(this.AlertimageBackground, destRect, this.AlertOverallBackGroundRect, GraphicsUnit.Pixel);
					if (this.AlertScroll)
					{
						int num3 = (int)((float)this.AlertMessageBackGroundRect.Width * this.AlertMessagePercentage / 100f);
						destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - num3) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)num3 * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
						e.Graphics.DrawImage(this.AlertimageMessage, destRect, new Rectangle(0, 0, num3, this.AlertMessageBackGroundRect.Height), GraphicsUnit.Pixel);
					}
					else
					{
						destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - this.AlertMessageBackGroundRect.Width) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)this.AlertMessageBackGroundRect.Width * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
						e.Graphics.DrawImage(this.AlertimageMessage, destRect, this.AlertMessageBackGroundRect, GraphicsUnit.Pixel);
					}
				}
				else
				{
					if (this.AlertGapRunning)
					{
						if (this.AlertFlashCount > 0)
						{
							this.DoAlertFlash(e, true);
						}
						else
						{
							destRect = new Rectangle(0, (int)((float)this.AlertOriginY * num2), (int)((float)this.AlertOverallBackGroundRect.Width * num), (int)((float)this.AlertOverallBackGroundRect.Height * num2));
							e.Graphics.DrawImage(this.AlertimageBackground, destRect, this.AlertOverallBackGroundRect, GraphicsUnit.Pixel);
							destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - this.AlertMessageBackGroundRect.Width) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)this.AlertMessageBackGroundRect.Width * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
							e.Graphics.DrawImage(this.AlertimageMessage, destRect, this.AlertMessageBackGroundRect, GraphicsUnit.Pixel);
							if (DateTime.Now.Subtract(this.AlertGapStartTime).TotalSeconds >= (double)this.AlertGapDuration)
							{
								if (this.AlertOccurences > 1)
								{
									this.AlertOccurences--;
									this.AlertMessageStartTime = DateTime.Now;
									this.AlertMessagePercentage = 0f;
								}
								this.AlertGapRunning = false;
							}
						}
					}
					else
					{
						destRect = new Rectangle(0, (int)((float)this.AlertOriginY * num2), (int)((float)this.AlertOverallBackGroundRect.Width * num), (int)((float)this.AlertOverallBackGroundRect.Height * num2));
						e.Graphics.DrawImage(this.AlertimageBackground, destRect, this.AlertOverallBackGroundRect, GraphicsUnit.Pixel);
						destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - this.AlertMessageBackGroundRect.Width) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)this.AlertMessageBackGroundRect.Width * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
						e.Graphics.DrawImage(this.AlertimageMessage, destRect, this.AlertMessageBackGroundRect, GraphicsUnit.Pixel);
						if (this.AlertFlash)
						{
							this.AlertFlashCount = this.AlertFlashCountMax;
						}
						this.AlertGapStartTime = DateTime.Now;
						this.AlertGapRunning = true;
					}
				}
			}
		}
		private bool DoAlertFlash(PaintEventArgs e, bool UsePercentageTime)
		{
			float num = (float)base.ClientRectangle.Width / (float)this._newBackgroundPicture.Width;
			float num2 = (float)base.ClientRectangle.Height / (float)this._newBackgroundPicture.Height;
			Rectangle destRect = default(Rectangle);
			float num3 = UsePercentageTime ? this.AlertMessagePercentage : 0f;
			if ((this.AlertFlashCount > 8 & this.AlertFlashCount < 12) || (this.AlertFlashCount > 0 & this.AlertFlashCount < 5))
			{
				destRect = new Rectangle(0, (int)((float)this.AlertOriginY * num2), (int)((float)this.AlertOverallBackGroundRect.Width * num), (int)((float)this.AlertOverallBackGroundRect.Height * num2));
				e.Graphics.DrawImage(this.AlertimageBackground_Inverse, destRect, this.AlertOverallBackGroundRect, GraphicsUnit.Pixel);
				int num4 = (int)((float)this.AlertMessageBackGroundRect.Width * num3 / 100f);
				destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - num4) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)num4 * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
				e.Graphics.DrawImage(this.AlertimageMessage_Inverse, destRect, new Rectangle(0, 0, num4, this.AlertMessageBackGroundRect.Height), GraphicsUnit.Pixel);
			}
			else
			{
				destRect = new Rectangle(0, (int)((float)this.AlertOriginY * num2), (int)((float)this.AlertOverallBackGroundRect.Width * num), (int)((float)this.AlertOverallBackGroundRect.Height * num2));
				e.Graphics.DrawImage(this.AlertimageBackground, destRect, this.AlertOverallBackGroundRect, GraphicsUnit.Pixel);
				int num4 = (int)((float)this.AlertMessageBackGroundRect.Width * num3 / 100f);
				destRect = new Rectangle((int)((float)(this.AlertMessageOriginX - num4) * num), (int)((float)this.AlertMessageOriginY * num2), (int)((float)num4 * num), (int)((float)this.AlertMessageBackGroundRect.Height * num2));
				e.Graphics.DrawImage(this.AlertimageMessage, destRect, new Rectangle(0, 0, num4, this.AlertMessageBackGroundRect.Height), GraphicsUnit.Pixel);
			}
			this.AlertFlashCount--;
			return this.AlertFlashCount > 0;
		}
		public void StopAlert()
		{
			this.AlertStartTime = new DateTime(2005, 1, 1);
		}
		private void RefTick(object state)
		{
			TimeSpan timeSpan = DateTime.Now.Subtract(this.RefStartTime);
			this.RefOverallCurrentPercentage = Convert.ToSingle(100.0 / this._refTransitionTime.TotalSeconds * timeSpan.TotalSeconds);
			if (this.RefOverallCurrentPercentage > 100f)
			{
				this.RefOverallCurrentPercentage = 100f;
			}
			TimeSpan timeSpan2 = DateTime.Now.Subtract(this.RefMessageStartTime);
			this.RefMessagePercentage = Convert.ToSingle(100.0 / this._refMessageTransitionTime.TotalSeconds * timeSpan2.TotalSeconds);
			if (this.RefMessagePercentage > 100f)
			{
				this.RefMessagePercentage = 100f;
			}
			base.Invalidate();
		}
		public void LoadRef(gf.SongSettings InItem, string InString, int InDuration, Font InFont, bool InUseScroll, bool InUseFlash, bool InTransparent, bool InUseShadow, bool InUseOutline, Color InTextColour, Color InBackColour, int InAlignment, int InVerticalAlignment, double BottomBorderFactor)
		{
			this.RefDisplayString = InString;
			if (!(InString == ""))
			{
				try
				{
					int num = this._newBackgroundPicture.Width;
					int num2 = (int)(gf.MinBottomBorderFactor * (double)((float)this._newBackgroundPicture.Height) * 1.1000000238418579);
					int num3 = (int)(gf.MinBottomBorderFactor * (double)((float)base.ClientSize.Height) * 3.0999999046325684);
					if (num < 1)
					{
						num = 1;
					}
					if (num3 < 1)
					{
						num3 = 1;
					}
					this.RefAlign = InAlignment;
					this.RefScroll = InUseScroll;
					this.RefFlash = InUseFlash;
					this.RefTransparent = InTransparent;
					this.RefBorder = num / 20;
					this.RefimageBackground = new Bitmap(num, num3);
					this.refg = Graphics.FromImage(this.RefimageBackground);
					InFont = new Font(InFont.Name, InFont.Size - 1f, InFont.Style);
					int num4 = gf.ReduceFontToFit(this.refg, InString, ref InFont, num - this.RefBorder, num3);
					this.RefMessageBackGroundRect = new Rectangle(0, 0, (int)this.refg.MeasureString(InString, InFont).Width, num4);
					num3 = num4 + 4;
					num2 = num2 * 2 + num3;
					this.RefimageBackground = new Bitmap(num, num3);
					this.refg = Graphics.FromImage(this.RefimageBackground);
					this.refg.Clear(Color.Transparent);
					this.RefimageBackground_Inverse = new Bitmap(num, num3);
					this.refg_Inverse = Graphics.FromImage(this.RefimageBackground_Inverse);
					this.refg_Inverse.Clear(Color.Transparent);
					this.RefimageMessage = new Bitmap(this.RefMessageBackGroundRect.Width, this.RefMessageBackGroundRect.Height);
					this.refMessageg = Graphics.FromImage(this.RefimageMessage);
					this.refMessageg.Clear(this.RefTransparent ? Color.Transparent : InBackColour);
					this.RefimageMessage_Inverse = new Bitmap(this.RefMessageBackGroundRect.Width, this.RefMessageBackGroundRect.Height);
					this.refMessageg_Inverse = Graphics.FromImage(this.RefimageMessage_Inverse);
					this.refMessageg_Inverse.Clear(this.RefTransparent ? Color.Transparent : InBackColour);
					gf.OutputOneLineToScreen(InItem, InString, InFont, this.refMessageg, InTextColour, StringAlignment.Center, InUseShadow ? 1 : 0, InUseOutline ? 1 : 0, 0, (num3 - this.RefMessageBackGroundRect.Height) / 2, this.RefMessageBackGroundRect.Width, 0);
					Rectangle rectangle = default(Rectangle);
					if (InVerticalAlignment == 0)
					{
						num2 = 0;
					}
					else
					{
						if (InVerticalAlignment == 2)
						{
							num2 = this._newBackgroundPicture.Height - num3;
						}
						else
						{
							num2 = this._newBackgroundPicture.Height - num2;
						}
					}
					rectangle.Height = num3;
					if (this.RefAlign == 3)
					{
						rectangle.X = num - (this.RefMessageBackGroundRect.Width + this.RefBorder * 2);
						rectangle.Y = num2;
						rectangle.Width = this.RefMessageBackGroundRect.Width + this.RefBorder * 2;
						this.RefMessageOriginX = rectangle.X + this.RefMessageBackGroundRect.Width + this.RefBorder / 2;
					}
					else
					{
						if (this.RefAlign == 1)
						{
							rectangle.X = 0;
							rectangle.Y = num2;
							rectangle.Width = this.RefMessageBackGroundRect.Width + this.RefBorder * 2;
							this.RefMessageOriginX = rectangle.X + this.RefMessageBackGroundRect.Width + this.RefBorder;
						}
						else
						{
							rectangle.X = 0;
							rectangle.Y = num2;
							rectangle.Width = this._newBackgroundPicture.Width;
							this.RefMessageOriginX = (this._newBackgroundPicture.Width - this.RefMessageBackGroundRect.Width) / 2 + this.RefMessageBackGroundRect.Width + this.RefBorder / 2;
						}
					}
					this.RefMessageOriginY = rectangle.Top + 1;
					this.RefOriginY = rectangle.Top;
					this.RefOverallBackGroundRect = new Rectangle(0, 0, num, num3);
					this.refg.FillRectangle(new SolidBrush(this.RefTransparent ? Color.Transparent : InBackColour), rectangle.X, 0, rectangle.Width, rectangle.Height);
					this.refg_Inverse.FillRectangle(new SolidBrush(this.RefTransparent ? Color.Transparent : InBackColour), rectangle.X, 0, rectangle.Width, rectangle.Height);
					this.RefTransitionTime = (float)InDuration;
					float refMessageTransitionTime = this.RefMessageTransitionTime;
					this.RefComputeOccurences(InString, this.RefTransitionTime, ref refMessageTransitionTime, ref this.RefOccurences);
					this.RefOccurences = 1;
					this.RefMessageTransitionTime = refMessageTransitionTime;
					this.RefGapRunning = false;
				}
				catch
				{
				}
			}
		}
		private void RefGo()
		{
			if (this.RefDisplayString != "")
			{
				this.RefOverallCurrentPercentage = 0f;
				this.RefMessagePercentage = 0f;
				this.RefRunning = true;
				this.RefStartTime = DateTime.Now;
				this.RefMessageStartTime = DateTime.Now;
				this.tr = new System.Threading.Timer(new TimerCallback(this.RefTick), null, 150, 150);
			}
		}
		private void RefComputeOccurences(string InString, float OverallDurationTime, ref float MessageDuration, ref int Occurences)
		{
			this.RefCharPerSecond = 8f;
			int num = (int)((float)InString.Length / this.RefCharPerSecond) + this.RefGapDuration;
			if ((float)num > OverallDurationTime)
			{
				this.RefCharPerSecond = (float)InString.Length / (OverallDurationTime - (float)this.RefGapDuration);
				Occurences = 1;
			}
			else
			{
				Occurences = (int)(OverallDurationTime / (float)num);
				if (Occurences == 0)
				{
					Occurences = 1;
				}
			}
			MessageDuration = (float)InString.Length / this.RefCharPerSecond;
			if (MessageDuration < 0f)
			{
				MessageDuration = OverallDurationTime;
			}
		}
		private void AddRefTextToImage(PaintEventArgs e)
		{
			if (this.RefRunning && this.RefimageMessage != null)
			{
				float num = (float)base.ClientRectangle.Width / (float)this._newBackgroundPicture.Width;
				float num2 = (float)base.ClientRectangle.Height / (float)this._newBackgroundPicture.Height;
				this.ClientBackgroundReducedRect = new Rectangle(0, (int)((float)this.RefOriginY * num2), (int)((float)this.RefOverallBackGroundRect.Width * num), (int)((float)this.RefOverallBackGroundRect.Height * num2));
				int num3 = (int)((float)this.RefMessageBackGroundRect.Height * num2);
				if (num3 >= this.ClientBackgroundReducedRect.Height)
				{
					this.ClientBackgroundReducedRect.Height = num3 + 2;
				}
				e.Graphics.ResetTransform();
				if (this.RefMessagePercentage < 100f)
				{
					e.Graphics.DrawImage(this.RefimageBackground, this.ClientBackgroundReducedRect, this.RefOverallBackGroundRect, GraphicsUnit.Pixel);
					if (this.RefScroll)
					{
						int num4 = (int)((float)this.RefMessageBackGroundRect.Width * this.RefMessagePercentage / 100f);
						this.ClientMessageReducedRect = new Rectangle((int)((float)(this.RefMessageOriginX - num4) * num), (int)((float)this.RefMessageOriginY * num2), (int)((float)num4 * num), num3);
						e.Graphics.DrawImage(this.RefimageMessage, this.ClientMessageReducedRect, new Rectangle(0, 0, num4, this.RefMessageBackGroundRect.Height), GraphicsUnit.Pixel);
					}
					else
					{
						this.ClientMessageReducedRect = new Rectangle((int)((float)(this.RefMessageOriginX - this.RefMessageBackGroundRect.Width) * num), (int)((float)this.RefMessageOriginY * num2), (int)((float)this.RefMessageBackGroundRect.Width * num), num3);
						e.Graphics.DrawImage(this.RefimageMessage, this.ClientMessageReducedRect, this.RefMessageBackGroundRect, GraphicsUnit.Pixel);
					}
				}
				else
				{
					if (this.RefGapRunning)
					{
						if (this.RefFlashCount > 0)
						{
							this.DoRefFlash(e, true);
						}
						else
						{
							this.ClientMessageReducedRect = new Rectangle(0, (int)((float)this.RefOriginY * num2), (int)((float)this.RefOverallBackGroundRect.Width * num), (int)((float)this.RefOverallBackGroundRect.Height * num2));
							e.Graphics.DrawImage(this.RefimageBackground, this.ClientMessageReducedRect, this.RefOverallBackGroundRect, GraphicsUnit.Pixel);
							this.ClientMessageReducedRect = new Rectangle((int)((float)(this.RefMessageOriginX - this.RefMessageBackGroundRect.Width) * num), (int)((float)this.RefMessageOriginY * num2), (int)((float)this.RefMessageBackGroundRect.Width * num), (int)((float)this.RefMessageBackGroundRect.Height * num2));
							e.Graphics.DrawImage(this.RefimageMessage, this.ClientMessageReducedRect, this.RefMessageBackGroundRect, GraphicsUnit.Pixel);
							if (DateTime.Now.Subtract(this.RefGapStartTime).TotalSeconds >= (double)this.RefGapDuration)
							{
								if (this.RefOccurences > 1)
								{
									this.RefOccurences--;
									this.RefMessageStartTime = DateTime.Now;
									this.RefMessagePercentage = 0f;
								}
								this.RefGapRunning = false;
							}
						}
					}
					else
					{
						e.Graphics.DrawImage(this.RefimageBackground, this.ClientBackgroundReducedRect, this.RefOverallBackGroundRect, GraphicsUnit.Pixel);
						this.ClientMessageReducedRect = new Rectangle((int)((float)(this.RefMessageOriginX - this.RefMessageBackGroundRect.Width) * num), (int)((float)this.RefMessageOriginY * num2), (int)((float)this.RefMessageBackGroundRect.Width * num), num3);
						e.Graphics.DrawImage(this.RefimageMessage, this.ClientMessageReducedRect, this.RefMessageBackGroundRect, GraphicsUnit.Pixel);
						if (this.RefFlash)
						{
							this.RefFlashCount = this.RefFlashCountMax;
						}
						this.RefGapStartTime = DateTime.Now;
						this.RefGapRunning = true;
					}
				}
			}
		}
		private bool DoRefFlash(PaintEventArgs e, bool UsePercentageTime)
		{
			float num = UsePercentageTime ? this.RefMessagePercentage : 0f;
			float num2 = (float)base.ClientRectangle.Width / (float)this._newBackgroundPicture.Width;
			float num3 = (float)base.ClientRectangle.Height / (float)this._newBackgroundPicture.Height;
			this.ClientBackgroundReducedRect = new Rectangle(0, (int)((float)this.RefOriginY * num3), (int)((float)this.RefOverallBackGroundRect.Width * num2), (int)((float)this.RefOverallBackGroundRect.Height * num3));
			int num4 = (int)((float)this.RefMessageBackGroundRect.Width * num / 100f);
			this.ClientMessageReducedRect = new Rectangle((int)((float)(this.RefMessageOriginX - num4) * num2), (int)((float)this.RefMessageOriginY * num3), (int)((float)num4 * num2), (int)((float)this.RefMessageBackGroundRect.Height * num3));
			if ((this.RefFlashCount > 8 & this.RefFlashCount < 12) || (this.RefFlashCount > 0 & this.RefFlashCount < 5))
			{
				e.Graphics.DrawImage(this.RefimageBackground_Inverse, this.ClientBackgroundReducedRect, this.RefOverallBackGroundRect, GraphicsUnit.Pixel);
				e.Graphics.DrawImage(this.RefimageMessage_Inverse, this.ClientMessageReducedRect, new Rectangle(0, 0, num4, this.RefMessageBackGroundRect.Height), GraphicsUnit.Pixel);
			}
			else
			{
				e.Graphics.DrawImage(this.RefimageBackground, this.ClientBackgroundReducedRect, this.RefOverallBackGroundRect, GraphicsUnit.Pixel);
				e.Graphics.DrawImage(this.RefimageMessage, this.ClientMessageReducedRect, new Rectangle(0, 0, num4, this.RefMessageBackGroundRect.Height), GraphicsUnit.Pixel);
			}
			this.RefFlashCount--;
			return this.RefFlashCount > 0;
		}
		public void StopRef()
		{
			this.RefStartTime = new DateTime(2005, 1, 1);
			this.RefRunning = false;
		}
		public bool RefStatus()
		{
			return this.RefRunning;
		}
	}
}
